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.

Transposing cells . .(like Excel)

Thread ID:

Created:

Updated:

Platform:

Replies:

31496 Jul 7,2005 07:07 PM Jul 8,2005 07:59 PM Windows Forms 3
loading
Tags: GridControl
Adam K.
Asked On July 7, 2005 07:07 PM

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 07:47 PM

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 01:21 PM

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 07:59 PM

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;
	}
}

CONFIRMATION

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.

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.

;