We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to transpose the Grid data?

By default, separate property is not available to transpose the Grid, that is, displaying the row data as column data. But, the Grid data can be transposed by changing the DataSource structure from row to column. This article explains how to transpose data for the GridDataBoundGrid and GridGroupingControl. For GridControl, please refer to this link: GridControl

Solution:

The row and column data can be transposed by customizing the DataSource as follows.

For GridDataBoundGrid:

The row and column data can be retrieved by using the GridModel. In this customization, the new DataSource is created (transposed data) from these retrieved data and this DataSource is assigned to the Grid.

C#

 

VB

 

For GridGroupingControl:

The row and column data can be retrieved by using the Table Records. In this customization, the new DataSource is created (transposed data) from these retrieved data and this DataSource is assigned to the Grid.

C#

 

VB

 

The following are the screenshots of the GridDataBoundGrid:

Figure 1: Initial DataSource

 

Figure 2: Transposed DataSource

The following are the screenshots of the GridGroupingControl:

Figure 3: Initial DataSource

 

Figure 4: Transposed DataSource

 

Sample Links:

GridDataBoundGrid:

CS: GDBG_Transpose_CS

VB: GDBG_Transpose_VB

 

GridGroupingControl:

CS: GGC_Transpose_CS

VB: GGC_Transpose_VB

Article ID: Published Date: Last Revised Date: Platform: Control:
5168 06/30/2015 06/30/2015 WinForms GridDataBoundGrid(Classic)
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon