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

Custom Editors

Thread ID:

Created:

Updated:

Platform:

Replies:

94964 Jun 15,2010 08:21 AM UTC Jun 22,2010 03:07 PM UTC Windows Forms 3
loading
Tags: Grouping
Genu Smith
Asked On June 15, 2010 08:21 AM UTC

Hi
1.How it is possible to use a third party control instead of GridGroupingControl's default column editors. for example:http://www.devcomponents.com/dotnetbar/ComboBoxTreeControl.aspx or a rating control

2.Is it possible to use different components to view and edit values in a cell.for example a picture box to view images and image uploader to edit the same column?

Regards

Jisha Joy [Syncfusion]
Replied On June 16, 2010 01:49 PM UTC

Hi Genu,

Please refer the sample in the below link that shows how custom column editor can be implemented in Grid.

Regards,
Jisha



GDBGCustomEditor_4432ab18.zip

Genu Smith
Replied On June 16, 2010 04:41 PM UTC

Hi Jisha
Thanks for your reply. But it was not what I mean.I want GridGroupingControl use my custom datepicker control instead of its built-in editors.Or I've written an ImageEditor control that can scan images.I want gridGroupingcontrol use that instead of its default picture box.I want to use custom or third party controls instead of builtin editors.

Regards

Christopher Issac Sunder K [Syncfusion]
Replied On June 22, 2010 03:07 PM UTC

Hi Genu,

Thanks for the update.

Applying third party controls instead of our built-in Syncfusion controls can be achieved by handling the style of a particular cell using QueryCellStyleInfo event. We can apply this by setting the Control property. But this wouldn’t be fine when we add the same to a range of cells. That is the value of a cell conflicts with another cell. Hence, it’s better that you can make use of customizing that particular control.
Here is the code snippet,


this.gridGroupingControl1.QueryCellStyleInfo += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);
void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.RowIndex == 10 && e.TableCellIdentity.ColIndex == 1)
{
e.Style.CellType = "Control";// This will consider the control property and set the given control’s type automatically
e.Style.Control = new NumericUpDown();// Microsoft’s control
}
}


I have created a sample with custom DateTimePicker control which is derived from DateTimePickerAdv control. Here is a code which illustrates the setting of styles using custom DateTimePicker control in a column. There is no conflicts happened with this custom derived control.


this.gridGroupingControl1.TableModel.CellModels.Add("DateTimePicker",new DateTimeCellModel(this.gridGroupingControl1.TableModel)); // register the cell model
this.gridGroupingControl1.TableDescriptor.Columns[2].Appearance.AnyRecordFieldCell.CellType = "DateTimePicker";
this.gridGroupingControl1.TableDescriptor.Columns[2].Appearance.AnyRecordFieldCell.CellValueType = typeof(DateTime);
this.gridGroupingControl1.TableDescriptor.Columns[2].Appearance.AnyRecordFieldCell.Format = "MM/dd/yyyy hh:mm";



Please refer the following sample which illustrates the above.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGC_CustomCellType_Final358587557.zip

Please let me know if you have any other concerns.

Regards,

Christopher K.

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

;