Hi,
I have two grids - summary and history. On selecting summary row, I need to determine the summary type and based on it hide/show some columns and change the order of some columns in history grid. InitializeLayout is working only on load but not dynamically.
How can I do this in a code?
Thanks
Victor
Thank you Alex.
Forgot to tell you that show/hide is working with Hiden property.
However, VisiblePosition is not working. I have this
gridSummary_AfterRowActivate (...)
{
if (type1)
gridHistory.DisplayLayout.Bands[0].Columns[
"AssociateName"].Header.VisiblePosition = 0;
....more code...
}
else
"AssociateType"].Header.VisiblePosition = 0;
....more code....
But the column order is not changing. It should be based on the value of type1. And type1 is kind of type of the summary record.
Hi, vkuzmich
UltraGridColumn has Hidden property. Use it to hide the corresponding columns.
grid.DisplayLayout.Bands[0].Columns["MyColumn"].Hidden = true
Also you need to use column.Header.VisiblePosition, that returns or sets the position of the column within its group, if the column belongs to a group, or its band, if the column belongs to a band.
grid.DisplayLayout.Bands[0].Columns["MyColumn"].Header.VisiblePosition = 5; //set the position you need.
Alex.