Hiding datagrid column give error
Hi,
I am reposting this under a new topic.
i am facing another new challenge. i am using .net VS2003 with v1.1 framework
instead of using dataset, i used the dataview as the datasource.
gdataGrid.DataSource = ds.Tables(0).defaultview
so that i can do sorting easily. Now i wish to hide one of the column in the datagrid. the data grid has edit and delete column followed by the dataview's column which consist of No, Item, Desc, etc.
I wish to hide the 'No' column. when i specifiy,
gdataGrid.DataSource = ds.Tables(0).defaultview
gdataGrid.DataBind()
gdataGrid.Columns("No").Visible = False
the above statement gives error and when i checked, the gdataGrid.columns().count gives only 2 (the Edit and the Delete columns). somehow, the columns in the dataviews are not being recognised. how to make the datagrid recognize the columns from the dataview?
I tried using the datagridtablestyle, but the datagridtablestyle is also not recognised by the editor.
Thanks.
|