Hey Guys,
I'm wondering if there is a simple way within the UltraGrid framework to solve this specific issue: Let's say I have 3 columns and I want to have the first column take 25% of the available width, the middle column take 50% of the available width and of course the last column have the remaining 25% width. I know it is possible to hard code the widths of the columns with this type of method:
ultraGrid1.DisplayLayout.Bands[0].Columns[0].Width = (int)((ultraGrid1.ActiveRowScrollRegion.Width) / 4.0);
but I'm trying to avoid issues relating to integer division, and taking into account when the scrollbar is visible or not. Is there something that I'm missing to set these types of custom column widths?
Hi,
I beleive you can do this using RowLayouts. What you would do is set the grid's AutoFitStyle so that the columns fit within the grid. Set UseRowLayouts on the Band to true to turn on RowLayout.
Then what you would do is use the RowLayoutColumnInfo on each column. You would set the PreferredSize on each column to the same width and set the WeightX on each one to some relative values like .25, .5, and .25 respectively.
Hi Mike,
Can you please post code example of this relevant to UltraWinGrid v 10.3?
Thanks.
Mike,
This is exactly what I was wondering how to do, thanks so much. UltraWinGrid is SO flexible, that it can be overwhelming to me.