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 );
// Create an instance of the ColumnChooserDialog.
new
// Set the Owner of the dialog to the form the WinGrid is on.
this
// ColumnChooserControl property returns the embedded UltraGridColumnChooser // control.
// Associate a WinGrid to the column chooser. This tells the column chooser // to display columns from this grid.
// 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.
// Style and MultipleBandSupport properties control important aspects of how //the column chooser operates.
// Set location, size etc...
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.