Ticket AS5563
Visible to All Users

Add the method to BandedGridView for Bands similar to the BestFitColumns method in GridView

created 19 years ago
Comments (1)
E E
Eric Comte Marois 12 years ago

    Wow… seven years… guess there's no point expecting it anymore now!

    Answers approved by DevExpress Support

    created 12 years ago (modified 12 years ago)

    Hi Crono,
    The BestFitColumns method does the trick for the BandedGridView. As for the AdvBandedGridView, its layout may be too complex. So, there is no way to calculate the best width of columns in a common scenario.
    Updated by Maxim (DevExpress Support)
    It is possible to simulate this feature manually for the BandedGridView. Call the BestFit method for all columns related to the current band.
    The following code illustrates how to do this:

    C#
    private void BestFil(GridBand gridBand) { gridBand.View.BeginUpdate(); foreach (BandedGridColumn column in gridBand.Columns) { column.BestFit(); } gridBand.View.EndUpdate(); }
    Visual Basic
    Private Sub BestFil(ByVal gridBand As GridBand) gridBand.View.BeginUpdate() For Each column As BandedGridColumn In gridBand.Columns column.BestFit() Next column gridBand.View.EndUpdate() End Sub

    I hope you find this approach useful.

      Show previous comments (6)
      DevExpress Support Team 12 years ago

        Hello,
        If I understand you correctly, you wish to have a simular workaround for the AdvBandedGridView instance. As we mentioned before, a layout of the AdvBandedGridView instance may be to complex for such an algorithm.
        I suggest that you create a new ticket and send your particular layout for further research. Possibly, we will find a specific solution for your case.

          I cant believe this hasent been implimented yet! Your solution of "Just best fit all the columns within the bands" is not good enough. What if the caption text of the band is longer than the columns? Surely this feature is a must?

          DevExpress Support Team 10 years ago

            Hello Chris,

            Yes, I see that if the caption text of the band is longer than the columns, the BestFitColumns method does not take into account the band width and does not produce the desired result. I created a separate ticket regarding this case on your behalf: T210043: How to use the BestFitColumns method in BandedGridView if the caption text of the band is longer than the columns. Our team will address it as soon as we have any updates.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.