Hello,
In the Asp.Net Grid view control I would add three attributes that would allow the row to change color when highlighted and when a row was clicked on it would call the gridview_rowcomand event.
I would like to be able to do this in the RadGrid. Here is what I have so far:
When I click on the row a post back fires but the Item_Command event is never called. How can I make this work? Here what I want to do:
1) Change BG color on Hover - done
2) When User clicks on a row preform a server side postback that tells me what row was selected.
Thanks
In the Asp.Net Grid view control I would add three attributes that would allow the row to change color when highlighted and when a row was clicked on it would call the gridview_rowcomand event.
I would like to be able to do this in the RadGrid. Here is what I have so far:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem ) |
{ |
e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='Silver'"); |
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFF'"); |
e.Item.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(this.RadGrid1, "Select$" + e.Item.ItemIndex,true); |
} |
} |
When I click on the row a post back fires but the Item_Command event is never called. How can I make this work? Here what I want to do:
1) Change BG color on Hover - done
2) When User clicks on a row preform a server side postback that tells me what row was selected.
Thanks