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

Why can''t get the real data from CurrentCell.Renderer.ControlText

Thread ID:





93756 Apr 1,2010 10:03 AM UTC Apr 15,2010 05:44 PM UTC ASP.NET Web Forms (Classic) 3
Tags: GridGroupingControl
Zhigang WANG
Asked On April 1, 2010 10:03 AM UTC


I got a issue about GridControl as below described,

1)Add a GridControl into a .NET windows form
2)Add event handler for the CurrentCellValidating and CurrentCellControlLostFocus events respectivly, the code as below,

private void gridControl1_CurrentCellValidating(object sender, CancelEventArgs e)
GridCurrentCell cc = this.gridControl1.CurrentCell;
Console.WriteLine("CurrentCellValidating,CurrentCell[{0},{1}]:{2}", this.gridControl1.CurrentCell.RowIndex, this.gridControl1.CurrentCell.ColIndex, cc.Renderer.ControlText);

private void gridControl1_CurrentCellControlLostFocus(object sender, ControlEventArgs e)
GridCurrentCell cc = this.gridControl1.CurrentCell;
Console.WriteLine("CurrentCellControlLostFocus,CurrentCell[{0},{1}]:{2}", this.gridControl1.CurrentCell.RowIndex, this.gridControl1.CurrentCell.ColIndex, cc.Renderer.ControlText);
Console.WriteLine("CurrentCellControlLostFocus,e.Control:{0}", e.Control.Text);

When i input a value, such as "123" in any cell and press 'Enter', i got following output,


My question is,
Why i can't get the value from CurrentCell.Renderer.ControlText in CurrentCellControlLostFocus eventhandler? the value can be got correcly from the e.Control.Text.

Just like the previous show, the current cell still has a 4 index for row and 2 index for column as same as in CurrentCellValidating eventhandle write out.

Is it a defect? or client must use e.Control replace the CurrentCell to get value?

Thanks a lot!

Rajadurai C [Syncfusion]
Replied On April 6, 2010 09:38 AM UTC

Hi Zhigang,

Thanks for your interest in Syncfusion Products.

The reported behavior is not a defect.

CurrentCellControlLostFocus event get triggerred when a cell is about to lose focus. When this event get triggerred, the values of the renderer get cleared as the focus is in the process of MoveTo where it was aware of its target cell.

Hence in this event, you can use either e.Control.Text or either of the following two code settings, to retrieve the current cell value.



Zhigang WANG
Replied On April 12, 2010 08:50 AM UTC


Thank you very much and Your descriptions are very concrete.
but seems cc.Renderer.ControlText can get the real value sometimes in our project, sorry for that i can't paste those code in here. the same scenario can't be reproduced in previous sample code.

The version we used in our project is

Those methods you said are work well, Big thanks!


Rajadurai C [Syncfusion]
Replied On April 15, 2010 05:44 PM UTC

Hi Zhigang,

Thanks for your update.

The case under which the ControlText property returns value in CurrentCellControlLostFocus event is, when the cell from which the focus is moved is in edit mode but not modified.

If the cell is in modified state and the focus is moved, then the renderer properties get cleared immediately as said before.



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