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

Bind childgrid

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
qw
Top achievements
Rank 1
qw asked on 05 Aug 2008, 05:33 AM
hi,
i m new in telerik
please tell
1) How to bind child grid without use any data source control ?
2) Find Datakeys value for parent grid in itembound event....

in advance thanks for help.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Aug 2008, 06:49 AM
Hello,

1.The following online demo link explains how to bind a child grid to the parent grid through the DetailTableDataBind event.
Hierarchy with DetailTableDataBind event

2.To get the DataKeyValue for the parent grid, try out the following code snippet.
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item=(GridDataItem)e.Item; 
            string strtxt = item.GetDataKeyValue("ProductName").ToString(); 
        }         
    } 

Thanks
Princy.

Tags
Grid
Asked by
qw
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or