This is a migrated thread and some comments may be shown as answers.

Hierarchical Grid Binding problem

1 Answer 14 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Farooq
Top achievements
Rank 1
Farooq asked on 22 Jul 2013, 09:25 AM
Hi every one,

I need your help please, I have Hierarchical Rad Grid, in which it has parent child relationship, I want to populate child details when you click on Parent row,.

I am using sqldatasource with stored procedure that has parameter, Master stored procedure has not parameter but child has. My problem is that how can i pass the parameter to child stored procedure when some one click on the row.

Thanks in Advance,

Regards,
S.M.Farooq

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 22 Jul 2013, 12:41 PM
Hi Farooq,

Please try the following code snippet.

C#:
public static string value = string.Empty;
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == "RowClick")
    {
        GridDataItem item=(GridDataItem)e.Item;
        value = item.GetDataKeyValue("DataKeyName").ToString();    
    }
}
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
    string datakeyvalue = value;//Access the datakey value of parent item
   //Your Code
}

Thanks,
Princy
Tags
General Discussions
Asked by
Farooq
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or