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

Adding a multiple table data set to a GridView control

1 Answer 90 Views
This is a migrated thread and some comments may be shown as answers.
Bahram Moinvaziri
Top achievements
Rank 1
Bahram Moinvaziri asked on 21 Nov 2008, 04:49 PM
I wanted to add a dataset which has three tables that are independant (i.e. do not have any relations). I use the following code to do this but it does not work.  What do i need to do?  I expect it to show me three plus signs one for each table in the same grid but it does not it only shows the "Report" table.
Bahram Moinvaziri


// radGridViewFCDetails  from the designer



this.radGridViewFCDetails.AllowShowFocusCues = true;
this.radGridViewFCDetails.AutoGenerateHierarchy = true;
this.radGridViewFCDetails.AutoGenerateHierarchyFromDataSet = true;
this.radGridViewFCDetails.AutoSizeRows = true;
this.radGridViewFCDetails.Dock = System.Windows.Forms.DockStyle.Fill;
this.radGridViewFCDetails.EnableAlternatingRowColor = true;
this.radGridViewFCDetails.EnableHotTracking = false;
this.radGridViewFCDetails.Location = new System.Drawing.Point(3, 17);
this.radGridViewFCDetails.Margin = new System.Windows.Forms.Padding(0);
this.radGridViewFCDetails.Name = "radGridViewFCDetails";
this.radGridViewFCDetails.ShowGroupPanel = false;
this.radGridViewFCDetails.Size = new System.Drawing.Size(702, 205);
this.radGridViewFCDetails.TabIndex = 64;


// these lines are in another function
radGridViewFCDetails.EnableHotTracking = false;
radGridViewFCDetails.MasterGridViewTemplate.EnableGrouping = true;
radGridViewFCDetails.MasterGridViewTemplate.AllowAddNewRow = false;
radGridViewFCDetails.MasterGridViewTemplate.AllowEditRow = false;
radGridViewFCDetails.MasterGridViewTemplate.AllowDeleteRow = false;
radGridViewFCDetails.MasterGridViewTemplate.EnableFiltering = false;
radGridViewFCDetails.MasterGridViewTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
radGridViewFCDetails.AutoGenerateHierarchy = true;
GridViewTemplate template1 = new GridViewTemplate();
template1.DataSource = fcResultsData.Tables["Summary"];

GridViewTemplate template2 = new GridViewTemplate();
template2.DataSource = fcResultsData.Tables["Error"];
radGridViewFCDetails.DataSource = fcResultsData.Tables["Report"];

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 24 Nov 2008, 04:28 PM
Hi Bahram Moinvaziri,

Thank you for your question.

Currently you can only add multiple tables in a chain hierarchy. In other words the only allowed hierarchy is the following:

Table --> ChildTable --> ... --> ChildTable

Do not hesitate to contact me if you have more questions.

All the best,
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Bahram Moinvaziri
Top achievements
Rank 1
Answers by
Telerik team
Share this question