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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Transposing cells . .(like Excel)

Thread ID:





31496 Jul 7,2005 11:07 PM UTC Jul 8,2005 11:59 PM UTC WinForms 3
Tags: GridControl
Adam K.
Asked On July 7, 2005 11:07 PM UTC

i am building a grid (using GridControl) where some users want to see the data in Rows and other user want to see the data in Columns. I would like the grid to have a toggle so users can switch back and forth. is there any example or any help that would help me in the right direction. thanks, ak

Administrator [Syncfusion]
Replied On July 7, 2005 11:47 PM UTC

You can use the virtual events to swap the roles of the rows and columns. Here is a little sample for a GridControl. http://www.syncfusion.com/Support/user/uploads/GC_FlipRowsColumns_d41c0bf6.zip

Adam K.
Replied On July 8, 2005 05:21 PM UTC

Clay, I am using your code but it looks like i am getting a bunch of exceptions in the grid because it seems to be really slow for me. i have attached my project. thanks, ak >You can use the virtual events to swap the roles of the rows and columns. Here is a little sample for a GridControl. > >http://www.syncfusion.com/Support/user/uploads/GC_FlipRowsColumns_d41c0bf6.zip > > BookingTester_1712.zip

Administrator [Syncfusion]
Replied On July 8, 2005 11:59 PM UTC

The exception is being caused by the fact that not all your grid cells are populated. You have to add a check to querycellinfo to avoid trying to use a null GridStyleInfoStore. Also, you are using the row and column headers. In this case, you would need to use row and col zero in the event as well.
private void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
	if(_flipped && e.ColIndex > -1 && e.RowIndex > -1)
		if(this.gridControl1.Data[e.ColIndex, e.RowIndex] != null)
			e.Style.ModifyStyle(this.gridControl1.Data[e.ColIndex, e.RowIndex], Syncfusion.Styles.StyleModifyType.Override);
		e.Handled = true;


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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