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

RadTree as column in RadGrid

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sagar Baheti
Top achievements
Rank 1
Sagar Baheti asked on 02 Sep 2008, 06:22 AM
Hi,
I am using RadGrid for Asp.Net ajax, now i have requirement as i want to insert RadTree in to the grid row and these trees are different for each RadGrid Row.
I am using DataSet as satasource for binding Grid. So could you  please tell me what should be the Stored procedure structure so i can bind data easily to tree.

Thanks and regard,
sagar

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Sep 2008, 08:16 AM
Hi Sagar,

Try the following code in the ItemDataBound event .

CS:
   protected void RadGrid4_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
     if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            RadTreeView treeview = (RadTreeView)data["Tree"].FindControl("RadTreeView1"); 
            int id=  Convert.ToInt32(dataItem["CategoryID"].ToString()); 
            //Write query to select Name based on the category id for each treeview and populate Dataset   
            treeview.DataTextField = "Name"
            treeview.DataSource = dsSet
            treeview.DataBind(); 
        } 

Thanks,
Princy
Tags
Grid
Asked by
Sagar Baheti
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or