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

Nested grid with 2 datatables

2 Answers 176 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 01 Apr 2011, 09:19 PM
Hi,

I have a requirement like:

I have 20 columns of a grid, and My user does not want all columns at a time, wanted to see 10 columns on screen. Now for that he is expecting to hide remaining 10 columns and show when it is required. So I am thinking to have 2 tables from a stored procedure, in which first will return columns which are by default available on grid and 2nd table will contain remaining 10 columns.

So common factor or parent relation will be on EmployeeID.

I tried to and I am successful till database level but somehow not able to bind data to database. I want to do this all in code behind as my stored procedure is quite complex and so dont want to use dataSourceID.

So anyone help me out to show nested grid through code behind?

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 04 Apr 2011, 04:46 AM
Hello Avinash,

Please take a look at the following Demo which demonstrates RadGrid's capability to auto-generate a hierarchical representation of a mutli-table DataSet. I hope it will help.
Grid / Autogenerate hierarchy

Thanks,
Princy.
0
Avinash
Top achievements
Rank 1
answered on 04 Apr 2011, 02:53 PM
I am agree to this code. However in this, datatables are created in code itself and added its relations.

I have one store procedure which returns me 2 tables and by default it should have all relation in between 2 tables.

So I want code or any reference in that sense where 2 tables fetched from database and used to create nested grid.
Tags
Grid
Asked by
Avinash
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Avinash
Top achievements
Rank 1
Share this question
or