I am using the radgrid to dispay quite a bit of data. To simplify the UI I have put the basic information into bound columns and given the user the option to expand each row using the nextviewtamplate to see a more detailed data much like this demo.
<telerik:RadGrid ID="grdTest" runat="server"> |
<mastertableview> |
<Columns> |
...columns generated here |
</Columns> |
<NestedViewTemplate> |
...Detailed data form here |
</NestedViewTemplate> |
<mastertableview> |
</telerik:RadGrid> |
I am also referencing this data on other pages and am trying to put a link to this page with a query string parameter of what record to expand. However I cannot seem to find how to set the "expanded row" through the server side code.
Here is an example of what I am trying to do
protected void grdTest_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) |
{ |
if (!string.IsNullOrEmpty(Request.QueryString["id"])) |
{ |
string DBIndentity = DataBinder.Eval(e.Item.DataItem, "ID", string.Empty); |
string QueryStringIdentity = Request.QueryString["id"]; |
if (DBIndentity == QueryStringIdentity) |
e.Item.Expanded = true; |
} |
} |
} |
Thanks in advance