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

Custom new row behavior in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

8598 Nov 13,2003 03:11 PM UTC Nov 13,2003 11:11 PM UTC WinForms 1
loading
Tags: GridControl
Gene Gorokhovsky
Asked On November 13, 2003 03:11 PM UTC

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 11:11 PM UTC

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.Focus();
	this.gridDataBoundGrid1.Model.HideRows[this.gridDataBoundGrid1.Model.RowCount] = false;
	this.gridDataBoundGrid1.CurrentCell.MoveTo(
		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;
}

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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;