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).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default Data in Add New Row

Thread ID:





37663 Nov 28,2005 07:54 PM UTC Nov 28,2005 11:44 PM UTC WinForms 3
Tags: Grouping
Peter Titus
Asked On November 28, 2005 07:54 PM UTC

I am looking for a way to default data into the add new row in the Grid Grouping Control (v. 3.3). I have a simple grouping with a group name and several items under it. Thanks for any help.

Administrator [Syncfusion]
Replied On November 28, 2005 08:22 PM UTC

You can try handling CurrentRecordContextChange and set the defaults there if you are starting to edit a record.
private void gridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
	if(e.Action == CurrentRecordAction.BeginEditComplete && e.Record is GridAddNewRecord)
		GridAddNewRecord rec = e.Record as GridAddNewRecord;
		rec.SetValue("Col0", "Col0Default");
		rec.SetValue("Col1", "Col1Default");
		rec.SetValue("Col2", "Col2Default");
		rec.SetValue("Col3", "Col3Default");

Peter Titus
Replied On November 28, 2005 10:17 PM UTC

Thanks for the help Clay. This worked well. I wouldn''t mind seeing this as a property in the columns collection. It would be nice to be able to handle this at design time.

Administrator [Syncfusion]
Replied On November 28, 2005 11:44 PM UTC

If you are using DataTables as the datasource for the grid, you can set the DataColumn.DefaultValue property for each column to provide a default value and the grid will use this. This way, you do not have to handle an event.


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