Hiding a column in datagrid
-
Hello, How do i hide a column in datagrid.my columns are being auto populated and not been created at design time.i tried doing Datagrid1.Columns(1).visible=False,but it throws an error. Thank You, chitranjan more dash than cash!!!
-
Hello, How do i hide a column in datagrid.my columns are being auto populated and not been created at design time.i tried doing Datagrid1.Columns(1).visible=False,but it throws an error. Thank You, chitranjan more dash than cash!!!
You should do this after binding the datagrid. Since no more columns before binding the data when using autogeneratecolumns=true. Regards R.Arockiapathinathan
-
You should do this after binding the datagrid. Since no more columns before binding the data when using autogeneratecolumns=true. Regards R.Arockiapathinathan
Actually i m doing that after Datagrid1.Databind() only.still its throwing IndexOutOfBounds exception saying that there is no column at that position. more dash than cash!!!
-
Actually i m doing that after Datagrid1.Databind() only.still its throwing IndexOutOfBounds exception saying that there is no column at that position. more dash than cash!!!
Use ItemDataBound Event for this. The old method is applicable for autogeneratecolumns=false only. So inside the ItemDataBound Event, put following code: e.Item.Cells[0].Visible=false; Regards R.Arockiapathinathan
-
Use ItemDataBound Event for this. The old method is applicable for autogeneratecolumns=false only. So inside the ItemDataBound Event, put following code: e.Item.Cells[0].Visible=false; Regards R.Arockiapathinathan
hey thanx that worked fine Regards, chitranjan more dash than cash!!!