Dynamically Show or Hide datagrid columns
We might come across situation where we want to dynamically show few columns of datagrid and to hide few columns based on some conditions
One way to acheive this is to is to create them at design time, and then to hide or show them as needed. we can do this by setting datagrid column's Visible property.
The following code shows how to toggle the visibility of the second column of the DataGrid.
DataGrid1.Columns(1).Visible = Not (DataGrid1.Columns(1).Visible)
One way to acheive this is to is to create them at design time, and then to hide or show them as needed. we can do this by setting datagrid column's Visible property.
The following code shows how to toggle the visibility of the second column of the DataGrid.
DataGrid1.Columns(1).Visible = Not (DataGrid1.Columns(1).Visible)
Labels: DataGrid

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home