The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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