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.
Syncfusion Feedback

CellType = "Control"

Thread ID:

Created:

Updated:

Platform:

Replies:

52606 Nov 30,2006 10:44 PM UTC Dec 4,2006 11:55 AM UTC Windows Forms 4
loading
Tags: GridControl
Kwabena Barwuah-Manu
Asked On November 30, 2006 10:44 PM UTC

Hi,

I want my new rows or cells to create a new instantance or object of my control.
How can I do this?

Thanks

Kwabena

Administrator [Syncfusion]
Replied On December 1, 2006 06:03 AM UTC

Hi Kwabena,

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 = userControl1;

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 DerivedCellControlTutorial sample in the browser samples for more details.
[install drive]\Syncfusion\Essential Studio\4.3.0.25\windows\Grid.Windows\Samples\In Depth\DerivedCellControlTutorial\

Best Regards,
Haneef

Kwabena Barwuah-Manu
Replied On December 1, 2006 03:15 PM UTC

Thanks for the your help.

NNR
Replied On December 1, 2006 11:06 PM UTC

What if I simply want a UserControl to handle the EditMode for a cell?

Do you have a simple example covering this?

Thanks

Administrator [Syncfusion]
Replied On December 4, 2006 11:55 AM UTC

Hi Jon,

To enable the in-place editing with a focus in a grid's usercontrol cell, you need to set Renderer.SupportFocusControl property to TRUE. Here is a code snippet ot show this.

public class DropDownGridCellRenderer: GridDropDownGridCellRenderer
{
GridControlBase grid;

public DropDownGridCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
: base(grid, cellModel)
{
this.SupportsFocusControl = true;
//this.DisableTextBox = true;
DropDownButton = new GridCellComboBoxButton(this);
this.grid = null;
}//Youe code here....
}

Please refer to the attached sample for implementation.
DropDownGridCellSample.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

;