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.

Custom new row behavior in GDBG

Thread ID:





8598 Nov 13,2003 10:11 AM Nov 13,2003 06:11 PM Windows Forms 1
Tags: GridControl
Gene Gorokhovsky
Asked On November 13, 2003 10:11 AM

Dear Syncfusion team, I need the following behavior 1) "*" row is not showing (set via grid.EnableAddNew = false or some other way) 2) Grid is sortable 3) when user clicks "Add" button elsewhere on the form a new blank row is added at the last position and focus is transferred to first editable cell in that row. 4) row/columnchanging events do not fire until user actually changes data in the cells (i.e. new row is not committed to datasource before user changes any data) What would be the way to approach this? Thanks, Gene

Administrator [Syncfusion]
Replied On November 13, 2003 06:11 PM

You could leave EnableAddNew set to true, but just hide the new row until you need it.
//in formload, hide the addnew row
this.gridDataBoundGrid1.Model.HideRows[this.gridDataBoundGrid1.Model.RowCount] = true;

private void button1_Click(object sender, EventArgs e)
	this.gridDataBoundGrid1.Model.HideRows[this.gridDataBoundGrid1.Model.RowCount] = false;
		this.gridDataBoundGrid1.Model.RowCount, 1, GridSetCurrentCellOptions.SetFocus);

private void gridDataBoundGrid1_CurrentCellStartEditing(object sender, CancelEventArgs e)
	this.gridDataBoundGrid1.Model.HideRows[this.gridDataBoundGrid1.Model.RowCount+1] = true;


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.