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

turn multiple rows into columns

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kurt Kluth
Top achievements
Rank 1
Kurt Kluth asked on 08 Jun 2017, 01:49 PM

Would it be possible to take the following recordset example and divide into multiple columns and then rows?  Currently we use a repeater to accomplish the goal but like the styling of the grid.  The RadGrid would give us more control of styling and exporting of the data much easier.

state   TotalCUs    TotalExcess TotalQualified
AL  4   3   0
CA  18  10  1
CO  1   1   0
DC  2   2   0
FL  6   6   0
GA  1   1   0

 

What we would like is to have 3 columns and then however many rows to complete the recordset.

state   TotalCUs    TotalExcess TotalQualified
AL  4   3   0   CA  18  10  1   CO  1   1   0
DC  2   2   0   FL  6   6   0   GA  1   1   0
ID  8   3   0   IL  26  9   0   IN  18  4   0
KS  1   1   0   KY  2   2   0   MD  2   0   0
ME  4   4   0   MI  4   3   0   MN  5   4   1
MO  5   5   0   NH  2   2   0   NJ  3   3   0
NV  7   4   0   OH  61  19  0   OK  2   2   0
OR  1   1   0   PA  6   6   0   TX  9   5   0
WA  2   2   0

Thanks for your help in advance.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 Jun 2017, 05:57 AM
Hello Kurt,

RadGrid does not have any built-in functionality to modify the database configuration. You should separate and flatten the source manually and pass it to the DataSource property of the grid within the NeedDataSource event handler:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-binding/understanding-data-binding/server-side-binding/advanced-data-binding-(using-needdatasource-event)

You can also check RadListView:
http://demos.telerik.com/aspnet-ajax/listview/examples/appearancestyling/predefinedlayouts/defaultcs.aspx

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Kurt Kluth
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or