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
1310
Dynamic Columnchooser
posted

In the wingrid, I have set the RowSelectorHeaderStyle.ColumnChooserButton, Once we have chosen the columns from the field chooser dialog, how do I dynamically reset the column chooser, in a buttonclick, i.e. to show all the columns in the grid.

// Create an instance of the ColumnChooserDialog. ColumnChooserDialog dlg = new ColumnChooserDialog( ); // Set the Owner of the dialog to the form the WinGrid is on. dlg.Owner = this; // ColumnChooserControl property returns the embedded UltraGridColumnChooser // control. UltraGridColumnChooser cc = dlg.ColumnChooserControl; // Associate a WinGrid to the column chooser. This tells the column chooser // to display columns from this grid. cc.SourceGrid = this.ultraGrid1; // Associate a band to the column chooser. This is useful if the WinGrid has // multiple bands and you want to display columns of a specific band rather // than columns of all bands. cc.CurrentBand = this.ultraGrid1.DisplayLayout.Bands[0]; // Style and MultipleBandSupport properties control important aspects of how //the column chooser operates. cc.Style = ColumnChooserStyle.AllColumnsAndChildBandsWithCheckBoxes; cc.MultipleBandSupport = MultipleBandSupport.SingleBandOnly; // Set location, size etc... dlg.Size = new Size( 150, 300 );
  • 469350
    Verified Answer
    Offline posted

    Hi,

    What do you mean by "dynamically?" You mean in code? Just look through the columns and set the Hidden property on each one to false.