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

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

Thread ID:

Created:

Updated:

Platform:

Replies:

57410 Mar 2,2007 05:45 PM Mar 2,2007 06:52 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 2, 2007 05:45 PM

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

Administrator [Syncfusion]
Replied On March 2, 2007 06:14 PM

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

Administrator [Syncfusion]
Replied On March 2, 2007 06:52 PM

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

CONFIRMATION

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

;