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.
Unfortunately, activation email could not send to your email. Please try again.

How do I swap rows and columns?

 

Rows and columns can be swapped in the GridControl by handling the virtual events QueryCellInfo, SaveCellInfo, QueryRowCount, and QueryColCount. While swapping, the actual row count is assigned to the column count in the QueryColCount handler and the actual column count is assigned to the row count in QuerRowCount handler. Here, the GridControl.Data property is used. The GridData holds StyleInfoStore objects with cell specific style properties. In the QueryCellInfo event handler, the style InfoObjects are provided in a swapped manner from the GridData and in the SaveCellInfo event handler, they are saved in the correct order to the GridData.

C#

VB

Figure 1: Before swap

Figure 2: After swap

Sample Links:

C#: SwapRowColumn

VB: SwapRowColumn

Article ID: Published Date: Last Revised Date: Platform: Control:
658 04/30/2011 04/17/2015 Windows Forms GridControl
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.