zimcoder Level: VB Lord

 Registered: 27-10-2003 Posts: 225
|
Re: Datagrid column hide and show ?
You can manipulate the columns collection of you DataGrid to hide or show any particular column
Here is simple illustrations
//MyDatagrid is a grid that has been bound to a datasource
MyDatagrid.Columns[2].Visible=false;
//Call the DataBind method on your datagrid afer hiding a column
MyDatagrid.DataBind(); |
This code hides the third column in your datagrid
You can use Column names if your Datagrid's columns have been autogenerated
[Edited by zimcoder on 30-07-2004 at 04:47 PM GMT]
____________________________
BrainBench ADO.NET and ASP.NET Certified Developer
 
|