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
130
Regarding hiding column and row.
posted

In Microsoft Excel, when you hide either a column or a row, the hidden column and row are known to users as you can see in my picture attachment. What I am interested in is whether I can do that on Infragistics WinGrid. For example, if I hide row 2 between row 1 and row 3, then I will see something between row 1 and 2 that there is a hidden row in fact. If this function is not supported, you can suggest me a way around it in order to achieve that users can see that there are hidden rows and columns.

  • 469350
    Offline posted

    Hi,

    The grid doesn't have this functionality. But you can allow the user to hide and show column via the ColumnChooser.


            private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridOverride ov = layout.Override;

                ov.RowSelectors = DefaultableBoolean.True;
                ov.RowSelectorHeaderStyle = RowSelectorHeaderStyle.ColumnChooserButton;
            }

    If you wanted to implement a more Excel-like style, then you would probably have to set the column width to something really small instead of actually hiding it. And then you might be able to use a CreationFilter to hide the cells. 

    Another alternative would be to hide the column and then use a CreationFilter to insert some sort of visible element into the column header(s) of the adjacent columns to allow the user to unhide the columns, but CreationFilters are advanced and if you haven't used them before, this would not be trivial.