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.

Split a gridControl cell in two parts

Thread ID:

Created:

Updated:

Platform:

Replies:

69872 Nov 15,2007 06:06 AM Oct 26,2011 11:59 PM Windows Forms 7
loading
Tags: GridControl
Nikos Triantafyllidis
Asked On November 15, 2007 06:06 AM

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


Jeba S [Syncfusion]
Replied On November 15, 2007 08:25 AM

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.



Nikos Triantafyllidis
Replied On November 16, 2007 02:43 AM

Great sample! Thanks a lot for assistance.

Best,

Nikos


Nikos Triantafyllidis
Replied On November 16, 2007 10:20 AM

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

Administrator [Syncfusion]
Replied On November 19, 2007 11:26 AM

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



Nikos Triantafyllidis
Replied On November 20, 2007 07:21 AM

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

Jeba S [Syncfusion]
Replied On November 21, 2007 02:15 AM

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.




doca
Replied On October 26, 2011 11:59 PM

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


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.

;