For a Grid databound control, I am just setting datasource property to a data table. I want to now hide two columns from the grid. I know the column name. I want to do this during runtime. How do I do that?
Note: I have not set any other properties of Grid databound control.
ADAdministrator Syncfusion Team August 10, 2005 02:48 AM
One way you can hide a column in a GridDataBoundGrid is to set grid.Model.ColWidths[colIndex] = 0;
ASAnna Srinivasan August 10, 2005 03:39 AM
I have written the following code:
gridDataBoundImport.DataSource = dataTable;
gridDataBoundImport.Model.ColWidths = 0;
But still the Grid is not hiding colindex=6.
Do I need to do anything else?
>One way you can hide a column in a GridDataBoundGrid is to set grid.Model.ColWidths[colIndex] = 0;
ADAdministrator Syncfusion Team August 10, 2005 03:43 AM
If you are doing this is form.load, you also have to set grid.AllowResizeToFit = true;
ASAnna Srinivasan August 10, 2005 04:22 AM
I have set the property to true. Sometimes it appears and sometimes it doesn''t. Do I need to set any other property?
How can I make the grid databound not editable?
ADAdministrator Syncfusion Team August 10, 2005 04:39 AM
To turn off editing grid-wide, you can set:
grid.EnableEdit = false;
grid.TableStyle.ReadOnly = true;
For the column not being hidden problem, please post a sample project showing it, and explain how to see the problem in your sample.