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.

Best way to Split Cells....

Thread ID:

Created:

Updated:

Platform:

Replies:

6620 Aug 19,2003 04:35 PM Aug 23,2003 04:14 AM Windows Forms 6
loading
Tags: GridControl
Jonathan Guidry
Asked On August 19, 2003 04:35 PM

I have a NonDB Virtual Grid, that is basically bound to a custom datasource. All Row sizes can accomodate 2 lines of wrapped text. I would like to split one of the column's cells and have 2 rows for each record. What is the best way to accomplish this Thanks, Jonathan

Administrator [Syncfusion]
Replied On August 19, 2003 06:11 PM

I am not sure I understand your request, but I think you would have to use covered cells to make the '1 cell columns' from 2 cell columns. You could use the QueryCoveredRange event to dynamically cover the cells. Attached is a little sample.

Jonathan Guidry
Replied On August 21, 2003 02:53 PM

Thats the idea, but is covered cells the best implementation? On first try with this method, I have a few issues: populatevalues writes data to every row even the covered rows, so I end up with 50% of the data. This may require a lot of work to correctly populate. I need to display each single record on two rows. I noticed a way to display one record on multiple rows. Could I use a combination of the two methods? Thanks for the Help! Jonathan

Jonathan Guidry
Replied On August 21, 2003 03:14 PM

It looks like you have to have a DBG for multi-row records. Any way to achieve the same functionality in a virtual grid? Thanks, Jonathan

Administrator [Syncfusion]
Replied On August 21, 2003 03:16 PM

I don't understand what you are trying to do. With a virtual grid, you normally would not be calling PopulateValues. Can you post a picture of a mock-up of what you are trying to accomplish?

Jonathan Guidry
Replied On August 22, 2003 02:07 PM

The sample you posted is exactly what I need to visually accomplish. There are a few UI issues, but I’m more concerned with displaying data on the grid. I’m “experimenting” with both standard and virtual grids, so I’m using “QueryCellInfo” with virtual grids, and “PopulateValues” with the standard grid. Sorry for any confusion. I’ve run into an issue using the virtual grid, it must query my custom data provider when repainting and this has a lot of overhead and causes jerky refreshes when resizing and moving. So I may have to use a standard grid. So, if I use PopulateValues with a standard grid, and used the covered cells, how do I make PopulateValues populate the records on every odd row? (Since every even row will be covered) Thanks, Jonathan

Administrator [Syncfusion]
Replied On August 23, 2003 04:14 AM

>>how do I make PopulateValues populate the records You cannot. But you are free to loop through your datasource and put the data anywhere in the grid your want. This can be done very quickly if you use the GridData object directly, and do not rely on indexers on the GridControl object. The reason is that indexers fire events, and this slows things down. To put data directly into the GridData object, you can use the grid.SetCellInfo method.
for (int row = 1; row <= nRows; row++)
{
	for (int col = 1; col < nCols; col++)
	{
		GridStyleInfo style = new GridStyleInfo();
		style.CellValue = //the value from your datasource for row, coll
		grid.SetCellInfo(row, col, style, StyleModifyType.Override, true, 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.

;