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

gridGrouping_RecordValueChanging

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 Vihar

1 Reply

AD Administrator Syncfusion Team July 17, 2006 12:13 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 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

Loader.
Live Chat Icon For mobile
Up arrow icon