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. (Last updated on: November 16, 2018).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
Syncfusion Feedback

GGC new row default values

Thread ID:





78968 Jan 14,2009 03:25 PM UTC Feb 5,2009 01:15 PM UTC WinForms 3
Tags: GridControl
Lan Mo
Asked On January 14, 2009 03:25 PM UTC

Hi there,

in GGC control, I want to set default values for some columns when a new row is added.

do you have a new-row-added event in GGC so that I can add code there to populate columns' default values? what is the best way to do that?

Thank you in advance.


Nisha Arockiya A [Syncfusion]
Replied On January 15, 2009 12:47 PM UTC

Hi Lan,

Thanks for your interest in Syncfusion Products.

The GridGroupingControl has options to have the addnew row in top and at the bottom. If you want to have this only at the bottom, add the below property settings.

this.GridGroupingControl1.TableDescriptor.AllowNew = true;
this.GridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
this.GridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordAfterDetails = true;

To add a new row programmatically in grid, you need to add a new row to the underlying datasource bound to the grid. The Grid just displays the rows from the bounded datasource.

Please try the below code. The below code gets the value for the first two columns from current record in grid and sets some default value to other columns for the new row added.

Record rec = this.gridGroupingControl1.Table.CurrentRecord;
if (rec != null)
object[] obj = new object[] { rec.GetValue("Col0"), rec.GetValue("Col1"), "someval", "someval", "someval" };
CurrencyManager cm = (CurrencyManager)(this.gridGroupingControl1.BindingContext[this.gridGroupingControl1.DataSource, this.gridGroupingControl1.DataMember]);
DataView dv = (DataView)cm.List;
catch (Exception ex)
throw ex;

Please let me know if this serve your needs.


Replied On January 30, 2009 01:43 PM UTC

The code:
" DataView dv = (DataView)cm.List;"
fails because I'm using Linq.
How can I add code there to populate columns default values if I use Linq ?

Nisha Arockiya A [Syncfusion]
Replied On February 5, 2009 01:15 PM UTC

Hi Jose,

Thanks for the Update.

Please refer to the following sample.

\My Documents\Syncfusion\EssentialStudio\\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\LINQGroupBy

Let me know if you find any difficultied.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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