zimcoder Level: VB Lord

 Registered: 27-10-2003 Posts: 225
|
Re: how to add column dynamically in datagrid ?
Adding a column to a datagrid is not very complex.
First Create a new datacolum
| DataColumn dc = new DataColumn("MyColumn",System.String); |
You the add the column to your datagrid's column collection
MyDatagrid.Columns.Add(dc);
//Note MyDatagrid is the declared datagrid |
You can add the column at a specific position //This adds the column on the third slot in the datagrid's column collection
MyDatagrid.Columns.AddAt(2,dc); |
hope this was helpful
[Edited by zimcoder on 30-07-2004 at 04:27 PM GMT]
____________________________
BrainBench ADO.NET and ASP.NET Certified Developer
 
|