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. Image for the cookie policy date
close icon

Best way to Split Cells....

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

6 Replies

AD Administrator Syncfusion Team August 19, 2003 10:11 PM UTC

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.


JG Jonathan Guidry August 21, 2003 06:53 PM UTC

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


JG Jonathan Guidry August 21, 2003 07:14 PM UTC

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


AD Administrator Syncfusion Team August 21, 2003 07:16 PM UTC

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?


JG Jonathan Guidry August 22, 2003 06:07 PM UTC

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


AD Administrator Syncfusion Team August 23, 2003 08:14 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon