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

GridGroupingControl: Changing column value.

Thread ID:





13903 May 13,2004 07:20 AM UTC May 13,2004 12:13 PM UTC WinForms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On May 13, 2004 07:20 AM UTC

Hello. Since I cannot bind datasource such way: http://www.syncfusion.com/Support/forums/message.aspx?MessageID=13836 I should set parent_ID column of newly created row manually. Please tell me how can done it. The best solution for me is to set cell value when the editing of new row begins. May be there is necessary event "NewRowCreated" ?

Administrator [Syncfusion]
Replied On May 13, 2004 07:50 AM UTC

You can also bind it with: DataSource = dataset1; DataMember = table1; And this will pick up the relation on table1, and auto populate the releated columns when you start editing a AddNew row in a child. Here is a little sample. nulls_1313.zip

Administrator [Syncfusion]
Replied On May 13, 2004 08:35 AM UTC

But in my situation I should show child table, not parent: this.gridGroupingControl1.DataSource = ds; this.gridGroupingControl1.DataMember = childTable.TableName; And parentID will not be assigned automatically. :(

Administrator [Syncfusion]
Replied On May 13, 2004 12:12 PM UTC

You can try handling the TableControlCurrentCellStartEditing event, and if it is teh AddNewRow, then set the value at this point.
private void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
	Element el = this.gridGroupingControl1.TableControl.Table.CurrentElement;
	if(el != null && el is GridAddNewRecord)
		Record r = el as Record;
		int col = this.gridGroupingControl1.TableControl.CurrentCell.ColIndex;
		int field = this.gridGroupingControl1.TableDescriptor.ColIndexToField(col);
		int someParentID = 1;
		r.SetValue("ParentID", someParentID);

Administrator [Syncfusion]
Replied On May 13, 2004 12:13 PM UTC

You do not need the col and field lines in the above snippet.


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

Live Chat Icon For mobile
Live Chat Icon