|
Rank: Newbie Groups: Member
Joined: 6/15/2011 Posts: 5
|
Can I use asp:ImageButton in EO.Grid control? I wanted ImageButton type column ( to display an icon on each row, instead of button type column).
Thanks in advance.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, No. You can not use ImageButton directly. You can display an image in the Grid cell though: http://www.essentialobjects.com/forum/postst3284_Picture-in-grid-cell.aspxIf you also wish to handle image click event, use a ButtonColumn instead of a StaticColumn. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/15/2011 Posts: 5
|
Thanks for the response. Based on the earlier post, I couldn't figure out if is this the correct format?
<eo:StaticColumn HeaderText="Operation" DataFormat='<img src="images/home.png" />' > </eo:StaticColumn>
Also, as you mentioned if I want to handle image click, I have to use 'ButtonColumn'. So does that mean, I can't have clickable image/icon?
Another question: I am trying to pupulate Grid's static column from array of strings (instead on database). I think this may be possible, but don't know how to define the 'DataField' of this column. When I pass string array to Grid's datasource, I get empty rows (same number as array). Here's the code:
string[] envs = /*getting array from somewhere*/ Grid1.DataSource = envs; Grid1.DataBind();
Thanks again!
|
|
Rank: Newbie Groups: Member
Joined: 6/15/2011 Posts: 5
|
I got 2nd part working by converting string array to DataTable.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can have clickable images in Grid cell. You would simply replace eo:StaticColumn with eo:ButtonColumn. Everything else such as DataFormat is the same.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/15/2011 Posts: 5
|
Thanks. That worked!!
|
|