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.

How can I handle adding new row to a GGC?

Thread ID:

Created:

Updated:

Platform:

Replies:

54577 Jan 11,2007 12:34 PM Jan 15,2007 03:13 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 11, 2007 12:34 PM

How can I handle adding new row to a GGC? What event can I use?

Administrator [Syncfusion]
Replied On January 12, 2007 12:27 AM

Hi Konstantin,

You can specify the AddNewRecord setting of the GroupingGrid with ShowAddNewRecordAfterDetails / ShowAddNewRecordBeforeDetails property. Here is a code snippet to show this.

//For Main Table.
this.grid.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.TopLevelGroupOptions.ShowAddNewRecordAfterDetails = false;

//For NestedTables
this.grid.NestedTableGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.NestedTableGroupOptions.ShowAddNewRecordAfterDetails = false;

//For Child Groups
this.grid.ChildGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.grid.ChildGroupOptions.ShowAddNewRecordAfterDetails = false;

If you want to control the add the new row through AddNewRecord, you need to handle the CurrentRecordContextChange event of the grid. Please find the code snippet below.

private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if(e.Action == CurrentRecordAction.EndEditCalled
&& e.Record.Kind == DisplayElementKind.AddNewRecord )
e.Cancel = true;
}

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 15, 2007 03:13 AM

Thank you Haneef, next hint was helpful

------------
private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
if(e.Action == CurrentRecordAction.EndEditCalled
&& e.Record.Kind == DisplayElementKind.AddNewRecord )
e.Cancel = true;
}
------------

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.

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.

;