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


Thread ID:





46579 Jul 17,2006 07:41 AM UTC Jul 17,2006 12:12 PM UTC Windows Forms 1
Tags: GridControl
Asked On July 17, 2006 07:41 AM UTC

Hi All, I am having a small problem.I am doing some what operation for checking duplicate entry in GridColumn in GGC.For this thing i have wrote the code in RecordValueChanging event.Its working fine as the till functionality.But i want to keep the entered text in cell even after ''''e.cancel = true'''' called.But right now as soon as i change the current field or press enter the entred text will no more in the cell. Any idea for this Query. Here is my coad. private void _gridGrouping_RecordValueChanging(object sender, RecordValueChangingEventArgs e) { if(e.Column == chkDuplicateForParent) { GridCurrentCell cc = s._gridGrouping.TableControl.CurrentCell; foreach(Record r1 in _gridGrouping.Table.Records) { string s = r1.GetValuechkDuplicateForParent).ToString(); object obj = e.NewValue; if(r1 != obj) { if(s == obj.ToString()) { MessageBox.Show("Duplicate Value = ''''"+s+"''''"); e.Cancel = true; cc.Renderer.ControlText = obj.ToString(); cc.Renderer.CurrentStyle.ApplyFormattedText(cc.Renderer.ControlText); cc.Activate(cc.RowIndex,cc.ColIndex); break; } } } } } Thanks & Regards

Administrator [Syncfusion]
Replied On July 17, 2006 12:12 PM UTC

Hi Vihar, When you set e.Cancel to true in the RecordValueChanging event, the newly entered text in the cell will not be there(because the event is cancelled by this property setting) and it will only retain the old value. This is an intended behavior of this property setting(e.cancel). You can avoid setting the e.Cancel = true in your code. Let me know if you need any further assistance. Regards, Rajagopal


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