Welcome Guest Search | Active Topics | Sign In | Register

how to auto-generate grid columns Options
mayuri
Posted: Wednesday, December 29, 2010 1:19:39 PM
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
eo_support
Posted: Wednesday, December 29, 2010 2:07:44 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.