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

Help needed displaying grid detail row/nested view with dynamic layout

3 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 06 Nov 2012, 06:54 PM
I need to display grid with pending changes to a set of records. The way I envisioned it, each master row would be a record itself. When you expand the row, the pending changes would be presented in a detail row. However, since each row will have different pending changes, the layout of this detail row would be different. I wanted to hide/display columns of each individual detail grid depending on pending changes to their master row record. So, if there's no pending change to a property, the corresponding column on this row will be hidden.  I've attached the picture illustrating my attempt.
I can't find a way to hide columns of the detail view for an individual row and I don't know if it's even possible. Does layout for each detail view have to be the same? Is detail view even a right way to accomplish this? Should I use nested view instead? 
I'd appreciate help pointing me to the right approach with some tips on what event handlers I should use to accomplish this.
Thanks,
Alex

3 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 09 Nov 2012, 03:15 PM
Hello Alex,

The regular hierarchy would not be suitable for such a custom scenario. You might use NestedViewTemplate or the newly introduced DetailItemTemplate.
For your convenience I created a very simple demo using the NestedViewTemplate and random values for testing purposes.

Kind regards,
Daniel
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
Alex
Top achievements
Rank 1
answered on 12 Nov 2012, 07:17 PM
Thanks!
I actually changed design a bit since I  figured if I swap columns with rows, then the layout will stay the same for all nested view rows and just the number of rows in the template will change. For example, first column would be "Old value", second column would be "New Value". In contrast, before I wanted to have "Old Value" row and "New Value" row and columns/loyout would be different from one detail row to another detail row. 

Just a hypothetical question though... Is it possible to have different lyouts from one nested view/detail row to another in the same grid?


0
Daniel
Telerik team
answered on 13 Nov 2012, 05:40 PM
Hello Alex,

You could change the contents of the nested view item dynamically. Depending on the functionality you'd like to implement, you can take a different route. If you have let's say two different (simple) layouts you can put them both in the template and then switch their visibility programmatically. Other than this you could also use a fully programmatic approach.

Best regards,
Daniel
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
Alex
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Alex
Top achievements
Rank 1
Share this question
or