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

What control for a row grouping with repeated records under?

1 Answer 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wayne
Top achievements
Rank 1
Wayne asked on 13 Jun 2016, 05:37 PM

My title is a bit weird as I'm having trouble explaining what I mean, so let me try to clarify.  I have a UI that is meant to have a single repeating row of "header" data and then "detail" data under it.  An example would be something like this in pseducode layout:

Header Row 1
Detail Row 1
Detail Row 2
Detail Row 3
Header Row 2
Detail Row 4
Detail Row 5
Detail Row 6

In MVC I would do something like this (again, pseudocode):

<table>
@foreach (var m in Model.EnrollmentPeriods) {
<tr class="header">
<td>@m.EnrollmentPeriodName</td>
<td><button id="newElectionButton">New Election</button></td>
</tr>
@foreach (var m2 in m.EnrollmentDetails) {
<tr>
<td>@m2.BenefitClass</td>
<td>@m2.Region</td>
<td>@m2.Band</td>
<tr>
@}
@}
</table>

 

I have looked at the RadGrid and RadListView, and neither seem to do what I want.  I'm not trying to use grouping, I basically need to have a way to say this set of data is repeated on this row, and this other set of data is repeated below it.  If you look at the attachment (hopefully it comes), the gray shaded area is the "header" portion that needs to be repeated and the white part is the "detail" records.  I can handle the button parts myself, it's mainly just the layout because none of the controls seem to allow for a non-grouping header row, and the gray part needs to be for each "section", it can't repeat with each row of data.

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 16 Jun 2016, 08:39 AM
Hi Wayne,

I am not quite sure whether this should be related to ASP.NET Web Forms or ASP.NET MVC. 

If you need to accomplish the same as with the pseudo razor code in Web Forms you might have a look at the asp:Repeater control. Or using the server code syntax in Web Forms and utilize a foreach loop—http://stackoverflow.com/questions/347472/foreach-or-repeater-which-is-better.

RadGrid and RadListView can accomplish the required results by disabling all possible features and customizing the rendered results through CSS, but they are far more advanced and I do not believe it is worth the effort.  

Regards,
Ianko
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
Wayne
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or