Welcome Guest Search | Active Topics | Sign In | Register

Setting Checkbox column value dynamically Options
bskumar
Posted: Tuesday, September 22, 2009 8:56:56 AM
Rank: Member
Groups: Member

Joined: 9/22/2009
Posts: 24
HI,

I am using EO Grid control in my application.I want to make checkbox active or Inactive and disabling "Delete" and "CheckBox" columns based on DB data(i.e i have "Active" and "IsUsed" columns in my table. if "Active" value is equal to "1" then i am making checkbox.checked = true and vice versa and if "IsUsed" value is greater than "0" then I am disabling "CheckBox" column and "Delete" button disabled.). In asp:Datagrid. I am doing dynamically in "ItemDataBound(object sender, DataGridItemEventArgs e)" event. How to do this using EO:Grid control.


Thanks in Advance,
Kumar.

bobwolf
Posted: Wednesday, October 20, 2010 3:46:12 PM
Rank: Member
Groups: Member

Joined: 5/31/2008
Posts: 25
I'm looking for the same.
There are any equivalent event (for ex: ItemDataBound - asp:DataGrid) to "EO Grid"?

Thanks.
Roberto.
eo_support
Posted: Wednesday, October 20, 2010 3:53:29 PM
Rank: Administration
Groups: Administration

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

There is no equivalent of ItemDataBound for EO Grid. However you can set the Grid cell value directly (you can not control the controls in the Grid cell directly like you do with ASP.NET DataGrid) using something like this:

Code: C#
//Make sure you call this AFTER you call DataBind
Grid1.Items[0].Cells[0].Value = "1";


I believe for a CheckBoxColumn, setting the cell value to "1" or true would check the checkbox.

Enable/Disable the checkbox is a totally different matter. It can be done with custom column but there is no easy way for you to do with the CheckBoxColumn. You can easily show/hide the checkbox with child CSS style selector though:

http://www.essentialobjects.com/forum/postst3177_Grid-checkbox-column-I-need-to-disable-checkbox-on-one-cell.aspx

Unfortunately the above trick does not work with enable/disable because CSS is presentational. It changes appearance but not behavior. So it can not be used to change whether the checkbox is clickable.

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.