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

grid inside a treeview

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Delia
Top achievements
Rank 1
Delia asked on 16 Aug 2010, 07:38 AM
Hi,

I would like to place a Grid inside a treeview ,treeview nodes are dynamic..

Click on a particular node , I have to show a grid/list to display values (like a matrix)..

Code that I am trying is below:-

Somehow the datatable is not binding to the grid & generating the script error

 

 

//creates a Node "Interventions"

 

 

 

 

RadTreeNode nodeInterventions = new RadTreeNode();

 

nodeInterventions.Text =

 

 

NodeConstants.InterventionNode;

 

 

 

 

//nodeInterventions.ContextMenuID = "MainContextMenu";

 

 

e.Node.Nodes.Add(nodeInterventions);

 

 

 

DataTable dtintervention=new DataTable();

 

dtintervention.Columns.Add(

 

 

"INTERVENTION");

 

dtintervention.Columns.Add(

 

 

"DISCIPLINE");

 

dtintervention.Columns.Add(

 

 

"FREQUENCY");

 

dtintervention.Columns.Add(

 

 

"DURATION_IN_WEEK");

 

 

 

 

 

foreach (DataRow row in data.Rows)

 

{

dtintervention.Rows.Add(row[

 

 

"INTERVENTION"].ToString(), row["DISCIPLINE"].ToString(), row["FREQUENCY"].ToString(), row["DURATION_IN_WEEK"].ToString());

 

 

}

//adding a dynamic grid to treeview

 

 

RadGrid rgrv_Interventions = new RadGrid();

 

rgrv_Interventions.DataSource = dtintervention;

rgrv_Interventions.DataBind();

//addign the control to the treenode

 

 

 

RadTreeNode nodeint = new RadTreeNode();

 

nodeint.Controls.Add(rgrv_Interventions);

nodeInterventions.Nodes.Add(nodeint);

}

Hi...
I am able to place a normal grid view..but why not a radgrid..

regards
Delia Joe

 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 18 Aug 2010, 04:43 PM
Hello Delia,

Refer to the forum threads below, which elaborate on this matter and see if they help to achieve your goal:
http://www.telerik.com/community/forums/aspnet-ajax/treeview/adding-the-radgrid-in-the-nodetemplate-dynamically.aspx
http://www.telerik.com/community/forums/aspnet/treeview/radgrid-as-a-node-in-radtreeview.aspx

Sincerely yours,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Delia
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or