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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CustomCellControl

Thread ID:

Created:

Updated:

Platform:

Replies:

88437 Jul 23,2009 07:37 AM UTC Mar 25,2010 06:10 AM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: Grouping
Karl-Michael Beck
Asked On July 23, 2009 07:37 AM UTC

Hello,

i'm using the GridGroupingControl.
i want to define a own control-type (per column).
The grid shall use this control to edit a cell for this column.
The control shall be instantiated when the user clicks the cell.
How can i achive such a behaviour?

There is a property
GridGroupingControl.TableControl.Model.Item(0,0).Control
but it remains on a nothing value when i try to set it.

When i try to set the backcolor of the GridTableCellSTyleInfo it won't work. Is it true that these Style infos are overwritten
by the values set in GridGroupingControl.Appearance?

Regards,
Karle

Jisha Joy [Syncfusion]
Replied On July 27, 2009 08:34 AM UTC

Hi Karle,

Thank you for using Syncfusion products.

A custom CellType can be created in a GridGroupingControl. Custom celltype 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, such as drawing it, handling mouse actions etc.

Here is the minimal sample which shows you how to create a custom celltype(which include the custom control "MyControl").
Sample

In GridGroupingControl we need to handle either QueryCellStyleInfo event or TableControlPrepareViewStyleInfo event to apply cell specific styles. See the code: You could check for the col/row index and set the styles.

this.gridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);


void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.ColIndex == 2 && e.TableCellIdentity.RowIndex == 5)
e.Style.BackColor = Color.SteelBlue;
}


Please let me know if you have any questions.

Regards,
Jisha

Varun Gupta
Replied On March 19, 2010 07:23 AM UTC

Hi Jisha,

I believe that it is possible to change the color of a regular cell also based on some conditions at runtime.

I am using a validation function which is called once the user has entered the data. If the validation fails on any data field, i need to update that cell red and display an error text next to it.

I am using the gridgroupingcontrol.tablemodel[row,col].Backcolor = Color.Red

But nothing is happening sadly.

Please advice

Thanks and Regards,
Varun

Rajadurai C [Syncfusion]
Replied On March 25, 2010 06:10 AM UTC

Hi Varun,

Thanks for your interest in Syncfusion Products.

It seems you have posted similar inquiry as an incident(#65945) in Direct Trac which is being followed up. Please followup with that for any further queries regarding this.

Regards,
Rajadurai

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

;