Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
610
Change columns order dynamically
posted

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

 

Parents
  • 1590
    posted

    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.

Reply Children