Rank: Newbie Groups: Member
Joined: 12/26/2010 Posts: 4
|
Sir, to overcome hinderance of not having AutoGeneratedColumns property Please guide us in how to write the code to dynamically create columns.
Mayuri
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Your code will be something like this:
Code: C#
//Create a new column. Note that there are different column
//types. So you will want to check the reference to see what
//column types are avaiable and which one works for your
//scenario
EO.Web.StaticColumn column = new EO.Web.StaticColumn();
//Setting the column properties. You usually need to set at
//least DataField. But other properties may also be important
//to you. Again check the reference to see what properties
//are available and use them accordingly
column.DataField = "your_db_field";
....setting other properties such as header text, etc
//Add the column to the Grid
Grid1.Columns.Add(column);
Hope this helps. Thanks!
|