Welcome Guest Search | Active Topics | Sign In | Register

Grid contorl seting Options
Luke
Posted: Tuesday, November 2, 2010 11:36:59 AM
Rank: Advanced Member
Groups: Member

Joined: 11/2/2010
Posts: 38
1. How to set the background color of a cell in the Grid control programmatically

2. Can I add a column to a grid control programmatically, since datasource table column is changing dynamically

Your help will be very appreciated.
eo_support
Posted: Tuesday, November 2, 2010 12:11:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

To change the cell background, you can either set this property on the server side:

http://doc.essentialobjects.com/library/1/eo.web.gridcolumn.stylefield.aspx

Or call this function on the client side:

http://doc.essentialobjects.com/library/1/jsdoc.public.gridcell.overridestyle.aspx

To add a column to the Grid, you just call your_grid.Columns.Add.

http://doc.essentialobjects.com/library/1/eo.web.gridcolumncollection.add.aspx

Hope this helps.

Thanks
Luke
Posted: Tuesday, November 2, 2010 3:25:38 PM
Rank: Advanced Member
Groups: Member

Joined: 11/2/2010
Posts: 38
I write: Grid.columns.add() but it had error, I don't know what I need to put in ().

would you give me an example.

Thanks
eo_support
Posted: Tuesday, November 2, 2010 3:32:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to be able to read the reference. There are dozens of controls and thousands of property/methods and millions of scenarios. There is no way we can give you sample code on each of these scenarios. The reference clearly documents the syntax for each class, method and property and you will need to be able to follow those.

Thanks
Luke
Posted: Tuesday, November 2, 2010 5:16:03 PM
Rank: Advanced Member
Groups: Member

Joined: 11/2/2010
Posts: 38
Only this one, Please ! I don't know what's wrong
eo_support
Posted: Tuesday, November 2, 2010 5:24:10 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to create a column first and then add it to the columns collection. For example:

Code: C#
//Create a new column
EO.Web.StaticColumn column = new EO.Web.StaticColumn();

//Add the column to the Grid's Columns collection
Grid1.Columns.Add(column);


There are different types of columns that you can create. For example, you can create an EO.Web.ButtonColumn instead of EO.Web.StaticColumn. You will also need to initialize the column correctly, for example, setting the columns' HeaderText so that the column will display header text.

Hope this helps. If you are still confused, then you should definitely ask someone around you to help you to read the reference. There is no point for us to repeat anything that's already there.

Thanks!
Luke
Posted: Tuesday, November 2, 2010 5:29:29 PM
Rank: Advanced Member
Groups: Member

Joined: 11/2/2010
Posts: 38
You are the best ! Thanks you so much ! I'm really appreciated.

have a good day !


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.