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. Image for the cookie policy date
close icon

How to grap the Text When Current Cell changed

Hi, I need to capture the current cell text when the text changed, i tried this by using CellLostFocus event but it firing only when i give tab otherwise it''s fails, which event suitable to solve this problem. Regards, padmanabhan.

5 Replies

AD Administrator Syncfusion Team April 4, 2006 07:13 AM UTC

Hi Padmanabhan, You can use the CurrentCellChanged and CurrentCellValidateString events to capture the current cell text when the text changed is changed. Below is the code snippet. // this.gridDataBoundGrid1.CurrentCellChanged += new EventHandler(gridDataBoundGrid1_CurrentCellChanged); private void gridDataBoundGrid1_CurrentCellChanged(object sender, System.EventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; Console.WriteLine("CurrentCellChanged :" + cc.Renderer.ControlText); } //this.gridDataBoundGrid1.CurrentCellValidateString += new GridCurrentCellValidateStringEventHandler(gridDataBoundGrid1_CurrentCellValidateString); private void gridDataBoundGrid1_CurrentCellValidateString(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellValidateStringEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; Console.WriteLine("CurrentCellValidateString :" + cc.Renderer.ControlText); } Best regards, Madhan


PA padhu April 4, 2006 01:14 PM UTC

Hi, Thank you for your timely help, but for the requirement purpose i am inherting the Syncfusion grid control in GetViewControl.cs here i can''t fire the event, how can i do this, give me the possible solution as early as possible pls. Thank you, Padmanabhan.


AD Administrator Syncfusion Team April 5, 2006 06:42 AM UTC

Hi Padmanabhan, You can call the OnCurrentCellChanged event in the inherited grid. Here is the code snippet protected override void OnCurrentCellChanged(System.EventArgs e) { base.OnCurrentCellChanged(e); Console.WriteLine(this.CurrentCell.Renderer.ControlText); } Best regards, Madhan


PA padhu April 5, 2006 12:31 PM UTC

Hi, This working fine for my requirement, but this event also firing when the drop down changed, it should not alow, is there any possible way. Thanking u, Regards, PADMANABHAN.


AD Administrator Syncfusion Team April 6, 2006 06:12 AM UTC

Hi Padmanabhan, You can check for the Cell Type ( this.CurrentCell.Renderer.StyleInfo.CellType == GridCellTypeName.TextBox ) in the OnCurrentCellChanged event to resolve this issue. Best regards, Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon