I have a column chooser associated with my wingrid. I need to add some fields to the column chooser. I have used this code.
myColumnChooser.CurrentBand.Columns.Add("NewColumnKey", "Column1");
This column is appearing on the grid and columnChooser. But it is selected by default. I need it to be deselected by default while adding. Is it possible.? If so please give me the sample code.
I also have a doubt that if I have added a column like I have mentioned above, will it be bound the data of the table if it is the same column name as that of the datasource? So that the wingrid will show the column values. If there is any way to do that please help me. I need to fetch the database columns dynamically.
Thanks in advance.
Kishor Kodakkatil
ugColumnChooser.CurrentBand.Columns.Add("NewColumnKey", "Column1"); ugColumnChooser.CurrentBand.Columns["NewColumnKey"].Hidden = true;
I have added the above code to make the column hidden and its worked fine.
Thank You Mike.
Software Developer
Hi Kishor,
myColumnChooser.CurrentBand is the band in the WinGrid. So you are adding a column to the grid, not the ColumnChooser.You cannot add a bound column to the grid. If you want to add a bound column, then you would have to add the column through your data source and not through the grid.
If you want it to be de-selected, you set the Hidden property on the column to true.