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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Controls in Grid Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

56018 Feb 8,2007 02:40 PM UTC Feb 13,2007 12:52 AM UTC WinForms 3
loading
Tags: GridControl
Ryan Hardoon
Asked On February 8, 2007 02:40 PM UTC

Hi
I have a class that is derived from a MaskedTextBox and would like a grid cell to be of this type. How do I do it.
Thanks.

Administrator [Syncfusion]
Replied On February 8, 2007 05:41 PM UTC

Hi Ryan,

If you want to host this control in a single grid cell, then you can do this by setting the celltype of the cell to be a control and then set the control that you want the cell to be associated with. Below is the code.

this.gridControl1[2,2].CellType = "Control";
this.gridControl1[2,2].Control = youruserControl1;

If you want to have this control in several cells, then you will have to create a custom celltype deriving the control. It requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell.

Please refer the CustomCellTypes category sample in the browser samples for more details.
[instal drive:] \Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On February 11, 2007 10:51 AM UTC

Hi Haneef.

Thanks for the answer, but I still have a problem.

I intend to display the data using a GridDataBoundGrid control. This, off course, requires me to work with columns rather than specific cells.
I already found out that the GridBoundColumn control has a CellType member, which I set to "Control", but I don't see how I set the GridBoundColumn to refer to MY control. MY control is an edit box derived from MaskedTextBox. I want all the cells in a specific column to be of the same time.
1. Can it be done with a GridDataBoundGrid ?
2. If not, can it be done with other grids ?



>Hi Ryan,

If you want to host this control in a single grid cell, then you can do this by setting the celltype of the cell to be a control and then set the control that you want the cell to be associated with. Below is the code.

this.gridControl1[2,2].CellType = "Control";
this.gridControl1[2,2].Control = youruserControl1;

If you want to have this control in several cells, then you will have to create a custom celltype deriving the control. It requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell.

Please refer the CustomCellTypes category sample in the browser samples for more details.
[instal drive:] \Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On February 13, 2007 12:52 AM UTC

Hi Ryan,

Can it be done with a GridDataBoundGrid ?
>>>
Yes. You can set the StyleInfo.Control property in a GridBoundColumn. Here is a code snippet.

this.gridDataBoundGrid1.Binder.InternalColumns[1].StyleInfo.CellType = "Control";
this.gridDataBoundGrid1.Binder.InternalColumns[1].StyleInfo.Control = yourcontrol;

Sample : GDBGControlCell.zip

Best regards,
Haneef

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.

Warning Icon 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.Close Icon

;