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

Updating grid info in AcceptChanges Event

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

4 Replies

AD Administrator Syncfusion Team 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;
}

            


WC Walter Cedeno February 17, 2005 10:12 PM UTC

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


AD Administrator Syncfusion Team 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


WC Walter Cedeno February 18, 2005 06:44 PM UTC

This works, thank you.

Loader.
Live Chat Icon For mobile
Up arrow icon