Hi all,
I have a grid that exists in 2 states (read-write and read-only). The user can toggle between these 2 at any time and the code needs to show/hide the editable columns based upon this event.
Currently, the code does this: Grid.DisplayLayout.Bands[ 0 ].Columns[ property.Name ].Hidden = !ReadWrite;
which "works" but seems to have some very strange layout behaviors. The columns will show-hide, but their position seems to shift and the remaining columns are also different widths after the operation. Is there anyway to get the columns to show-hide IN PLACE without affecting any other columns?
Thanks for your help,
Thanks for those screenshot.
I'm not entirely certain what you mean by "shift" in this situation. Are you talking about how the hidden columns appear interspersed among the read/write columns? If so, you can control where the hidden columns appear by setting their Header.VisiblePosition property (you can set this even when the columns aren't visible).
If this isn't what you're talking about, then can you please elaborate on what the issue is? What is the result that you're expecting?
With the Screen-B attachment.
Hi Vince,
Thanks for replying. I've attached 2 screen shots - the first, screen-A is the orignial state of the grid after loading a saved layout. The second, screen-B, is what the grid looks like after I've gone through 1 round of "Show read/write columns".
The read/write columns are {Comments, Order Quantity, Order Price, Duration, Dest} as indicated by the yellow-ish background. They are defaulted to visible, so in theory, setting the UltraGridColumn.Hidden flag (to true) on these rows shouldn't make any difference. However, as you can see in screen-B, they shift somewhat dramatically.
Thanks in advance,
bmm727 said:The columns will show-hide, but their position seems to shift and the remaining columns are also different widths after the operation.