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

Split a gridControl cell in two parts

Hello everyone,

I have a gridControl and i would like to know how i can make a cell split in two, if possible.

Thanks in advance for any answers.

Nikos


7 Replies

JS Jeba S Syncfusion Team November 15, 2007 01:25 PM UTC

Hi Nikos,

Thank you for posting query to us.

You can create custom celltype to split a Gridcontrol cell and add the newly created celltype to the CellModels. Then assign the custom celltype to the grid cells respectively.


gridControl.CellModels.Add("NewSplitCells", new GridCurrencyCellModel(gridControl.Model));
gridControl[0, 1].CellValue="SplitCells";
gridControl[2, 1].CellType = "NewSplitCells";


Please refer the sample which shows the splitcells in GridControl:
http://websamples.syncfusion.com/samples/Grid.Windows/I39040/main.htm

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.




NT Nikos Triantafyllidis November 16, 2007 07:43 AM UTC

Great sample! Thanks a lot for assistance.

Best,

Nikos



NT Nikos Triantafyllidis November 16, 2007 03:20 PM UTC

Thank again for your reply.

I have one more question. In the sample you sent me have i added to the CurrencyGrid and to its parent gridControl the event QueryColWidth so the columns can be resized accordingly when the form is resized by dragging. The problem is that now that i have such a split cell the behavior is not proper during this resizing. Is there a way to achieve this effect in this case of a spit cell?

Thank you once more for your reaction.

Nikos



GridSplit.zip


AD Administrator Syncfusion Team November 19, 2007 04:26 PM UTC

Try code such as this that treats column 1 the same as any other column.

protected void HandleQueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if (e.Index > gridControl.Model.Cols.HeaderCount)
{
int clientWidth = gridControl.ClientRectangle.Width - gridControl.Model.ColWidths[0] - 4;
e.Size = (clientWidth / (gridControl.Model.ColCount - gridControl.Model.Cols.HeaderCount));
e.Handled = true;
}
}




NT Nikos Triantafyllidis November 20, 2007 12:21 PM UTC

As you can see in the sample i have 6 cells as custom 'splitCells' and there exist two major problems:
1) When the form loads the 'slitCells' are not automatic sized to cover all the available width of the parent grid column. This is achieved ONLY when i click on the cell
2) When i click on the 'splitCell' the is a non stop flickering that takes place.

I would really appreciate some hints for these two issues

>Try code such as this that treats column 1 the same as any other column.

protected void HandleQueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if (e.Index > gridControl.Model.Cols.HeaderCount)
{
int clientWidth = gridControl.ClientRectangle.Width - gridControl.Model.ColWidths[0] - 4;
e.Size = (clientWidth / (gridControl.Model.ColCount - gridControl.Model.Cols.HeaderCount));
e.Handled = true;
}
}






GridSplit.zip


JS Jeba S Syncfusion Team November 21, 2007 07:15 AM UTC

Hi Nikos,

Thank you for your update.

Please refer the Direct Trac incident 39207 to follow this query.

Thank you for your interest in Syncfusion Products.

Best Regards,
Jeba.





DO doca October 27, 2011 03:59 AM UTC

I want to split a grid cell in to two parts (like to rows).
there is previous post about this but its links not valid .

http://www.syncfusion.com/support/forums/grid-windows/69872/split-a-gridcontrol-cell-in-two-parts


Loader.
Live Chat Icon For mobile
Up arrow icon