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

Nested RadGrid and selecting only one row in the whole grid

4 Answers 281 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jarkko
Top achievements
Rank 1
Jarkko asked on 20 Aug 2012, 12:40 PM
Hi, 

I tried searching the forum and found a couple of threads, but they didn't help. I have a RadGrid that has another RadGrid nested which also has another nested RadGrid. So there are 3 levels: Level 1 has information about a costumer, level 2 has information about customer´s purchases, and level 3 has info about products that the costumer has bought during the purchase.  

I have a GridClientSelectColumn (and the AllowRowSelect="True" in <ClientSettings>) on the level 2 (the purchases). I can access the selected purchase by iterating trough all items in the whole radgrid and checking which item has its Selected set to true. 

My problem is I cannot figure out how to make it so that only one purhase (level 2 item) could be selected in the whole grid. Right now I can select one purchase per each customer, which is not at all what I want. I guess I should somehow always unselect the previous selection just before selecting the new one.

I tried to subscribe to SelectedIndexChanged of the nested radgrid, but it doesn´t seem to fire. Which event should I use? 

I also found out that this could done with some client side javascript trick, but I am not sure how to do it. Also I would like to do this on the server side if possible...

So what is the "official" way to achieve this "select only one row among nested radgrids" -scenario?

4 Answers, 1 is accepted

Sort by
0
Jarkko
Top achievements
Rank 1
answered on 22 Aug 2012, 09:54 AM
Anyone?
0
Accepted
Eyup
Telerik team
answered on 22 Aug 2012, 03:14 PM
Hi Jarkko,

The requested functionality could be achieved both on server and on client-side. Please check out the attached web sites and determine which approach suits best your requirements.

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ben
Top achievements
Rank 1
answered on 09 Nov 2012, 02:44 AM
I have the nested example you attached working, but each time I select a new row on the outer grid and I had a previous row with details open, it displays the new row detail with the inner grid and it also uses the same grid for the row that was previously opened. The two rows that are now open are displaying the same details, which is incorrect. The original row should not change and should continue to display it's data and the new row should display it's details. I don't know why both are displaying the same details. It's like the last row to be clicked on is the row detail that is used for all open rows in the outer grid.
0
Eyup
Telerik team
answered on 14 Nov 2012, 08:55 AM
Hi Ben,

Please note the binding in this example is for test purposes only to demonstrate the selecting approach. For actual NestedViewTemplate hierarchy binding implementation, please check out the following demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

I hope this will prove helpful.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Jarkko
Top achievements
Rank 1
Answers by
Jarkko
Top achievements
Rank 1
Eyup
Telerik team
Ben
Top achievements
Rank 1
Share this question
or