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

Updating grid info in AcceptChanges Event

Thread ID:

Created:

Updated:

Platform:

Replies:

25098 Feb 17,2005 07:02 PM UTC Feb 18,2005 06:44 PM UTC WinForms 4
loading
Tags: GridControl
Walter Cedeno
Asked On February 17, 2005 07:02 PM UTC

After receving a AcceptChanges event, I am trying to update the information for the current cell and other cells in the same row. I use the following code to do this but the values are not displayed on the grid; int col = gdbg.CurrentCell.ColIndex; int row = gdbg.CurrentCell.RowIndex; gdbg.BeginUpdate(BeginUpdateOptions.Invalidate); gdbg[row, col].CellValue = "Some text"; gdbg[row, col+1].CellValue = "Some other text"; gdbg.RefreshRange(GridRangeInfo.Row(gRow), true); gdbg.EndUpdate(true); I tried also updating the appropriate datasource row as well with similar results. Walter

Administrator [Syncfusion]
Replied On February 17, 2005 08:20 PM UTC

Try this code.
private bool cellChanged = false;
private void gridDataBoundGrid1_CurrentCellValidating(object sender, CancelEventArgs e)
{
	this.cellChanged = true; 
}
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
	if(this.cellChanged)
	{
		int col = gridDataBoundGrid1.CurrentCell.MoveFromColIndex;
		int row = gridDataBoundGrid1.CurrentCell.MoveFromRowIndex;
		gridDataBoundGrid1[row, col].CellValue = "SomeText";
		gridDataBoundGrid1[row, col+1].CellValue = "xxxxxxx";
		gridDataBoundGrid1.RefreshRange(GridRangeInfo.Row(row), true);
		gridDataBoundGrid1.Binder.EndEdit();
	}
	this.cellChanged = false;
}
 

Walter Cedeno
Replied On February 17, 2005 10:12 PM UTC

Now, I am able to see the changes to all columns except the one we moved from.

Administrator [Syncfusion]
Replied On February 17, 2005 10:44 PM UTC

Using 3.0.1.0, I do not see this problem in this sample. Do you? http://www.syncfusion.com/Support/user/uploads/GDBG_UpdateRow_588bedbf.zip

Walter Cedeno
Replied On February 18, 2005 06:44 PM UTC

This works, thank you.

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

;