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.
Syncfusion Feedback

Updating grid info in AcceptChanges Event

Thread ID:





25098 Feb 17,2005 02:02 PM Feb 18,2005 01:44 PM Windows Forms 4
Tags: GridControl
Walter Cedeno
Asked On February 17, 2005 02:02 PM

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 03:20 PM

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)
		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);
	this.cellChanged = false;

Walter Cedeno
Replied On February 17, 2005 05:12 PM

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

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

Using, 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 01:44 PM

This works, thank you.


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.

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