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

Help! GGC sample showing how to enter new data in a new row

My GGC new row (*) doesn't want to keep the data I enter into it. Any hints?

2 Replies

AD Administrator Syncfusion Team March 2, 2007 11:14 PM UTC

Hi,

This is a default behavior. But one way you can do this by handling the CurrentRecordContextChanging event of the grid and set e.Cancel to true when the record is AddNewRecord.

private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if( e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditCalled )
{
GridAddNewRecord record = e.Record as GridAddNewRecord ;
if( record != null )
e.Cancel = true;
}
}

Best regards,
Haneef


AD Administrator Syncfusion Team March 2, 2007 11:52 PM UTC

Thanks, that appears to work, however, my settings from QueryCellStyleInfo don't stay once I hit enter:
I have a default value and a values from in-cell combo box:

if (e.TableCellIdentity.Column.MappingName == "Col1")
{
e.Style.BackColor = Color.Gray;
e.Style.ReadOnly = true;
e.Style.CellType = "Static";
e.Style.CellValue = 0;
}

if (e.TableCellIdentity.Column.MappingName == "Col2")
{
e.Style.CellType = "ComboBox";
ArrayList typeList = new ArrayList(2);
typeList.Add("val1");
typeList.Add("val2");
typeList.Add("val3");
e.Style.DataSource = typeList;


Do you know why this happens? The '0' disappears, and the combo does not activate unless I double click it - but then the data I entered up to that point disappears

Any clues?


>Hi,

This is a default behavior. But one way you can do this by handling the CurrentRecordContextChanging event of the grid and set e.Cancel to true when the record is AddNewRecord.

private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if( e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditCalled )
{
GridAddNewRecord record = e.Record as GridAddNewRecord ;
if( record != null )
e.Cancel = true;
}
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon