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

Creating my own cell errors

Thread ID:





60062 Apr 26,2007 07:34 PM UTC Apr 27,2007 10:04 PM UTC WinForms 4
Tags: GridControl
Rocky Tatlay
Asked On April 26, 2007 07:34 PM UTC

I’m trying to simulate behavior when a cell is in error. I need my grid grouping control to show a particular cell(which I determine) is in error by displaying the red exclamation image in the cell and setting the tool tip of the cell to a customized error of my choosing.

I’m able to determine the record in error and the column where the error occurred from my dataset. (There may be multiple error within a record).

Within an initialization method I made, I tried to set the tool tip within a cell by using:

this.ggcErr.Table.GetTableCellStyle(record_item, “Column name”).CellTipText = “Error message”;

This does not set the tool tip for that cell.

Next I tried to use this:

gsi = (GridStyleInfo)this.ggcErr.Table.GetTableCellStyle((record_item, “Column name”));

gsi.CellTipText = “Error message”;

This also does not work;

Is there any way for me to set a cell of my choosing to indicate an error and set a customized tool tip for that cell?

I ‘m trying not to use QueryCellStyleInfo, it gets called too many times the cumpuation on every cell will be too costly. I do not need to check every cell within the grid too see if they are in error, my dataset has the exact items which are in error.

haneefm [Syncfusion]
Replied On April 26, 2007 07:57 PM UTC

Hi Rocko,

Here is a forum thread that discuss with the simillar issue.

Best regards,

Rocky Tatlay
Replied On April 27, 2007 02:11 AM UTC

Hi Haneef,

The examples are very close to what I need, except for a few differences.

I’m designing a grid which contains invoices that need editing in particular cells.

I want to mark every cell that needs editing when I initialize the grid. These cells will have the red exclamation mark and the cell tip. I load the data set with the exact columns within the records where the edit is required.

The examples given all use a user generated event to kick off the customized validation. The approach I’m taking is I initialize the grid and go through each record in the grid to determine where the edit is required and set the error and cell message. There will be multiple cells that will be marked this way.

The gridGroupingControl1_TableControlCurrentCellValidating() isn’t useful for me at this point because the user is not invoilved during the initalization, the cells in question are predetermined, im just trying to mark each of them. Is there a way to do this without using user events?

In a nutshell, im trying to do this:

foreach (Record record_err in this.ggcInvErr.Table.Records){

//Logic to find exact record and column that needs editing
//Now that I know the column and record how do I mark this cell and set cell tip on grid?
What do I do to record_err to achieve this?

Rocky Tatlay
Replied On April 27, 2007 08:49 PM UTC

Just wondering if there is any update yet, thanks.

haneefm [Syncfusion]
Replied On April 27, 2007 10:04 PM UTC

Hi Rocko,

If you want to draw the Exclamation mark on invalid cell, you need to handle the TableControlDrawCell event of the grid and draw image using the Graphics.DrawImage method. Here is a code snippet.

private void gridGroupingControl1_TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if( style != null
&& style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record
&& e.Inner.Style.Tag != null
&& style.TableCellIdentity.Column != null
&& style.TableCellIdentity.Column.Name == "OtherInfo" )
Rectangle rect =new Rectangle( new Point(e.Inner.Bounds.Right - 20,e.Inner.Bounds.Top ),new Size(20,e.Inner.Bounds.Height));
e.Inner.Graphics.DrawImage(RedExclamation ,(RectangleF)rect);

Please refer to modifed sample for more details.

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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