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
close icon

GridDataBoundGrid..exception after cell edit lost focus.

Hi,

I am using GridDataBoundGrid control.
I have 2 columns in edit mode.

On lost focus on grid cell I do calculate my Entity values manually and rebind the source with the grid to reflect the changes to the Entity.

On Lost focus when I rebind the grid It gives me the below Exception.
"Do not move current position with this method!"

I have tried 2-3 options but not success.
Below are the functions.

private void form1_Load(object sender, EventArgs e)
{
datagrid.Binder.DirectSaveCellInfo = false;
datagrid.CurrentCellAcceptedChanges += new CancelEventHandler(datagrid_CurrentCellAcceptedChanges);
}


private void datagrid_CurrentCellControlLostFocus(object sender, ControlEventArgs e)
{
//does the changes on entity
CalculateValue()
BindGrid();
datagrid.Refresh();
}

void datagrid_CurrentCellAcceptedChanges(object sender, CancelEventArgs e)
{
try
{
datagrid.Binder.EndEdit();
BindGrid();
datagrid.Refresh();
}
catch (Exception ex)
{
}
}

Any suggestions/solutions?

2 Replies

HA haneefm Syncfusion Team April 30, 2007 06:12 PM UTC

Hi Santosh,

You can try use CurrentCellValidating event to resolve this issue and let me know if this helps.

Best regards,
Haneef


MA Mark Atkinson May 17, 2007 12:18 AM UTC

I'm also getting this message box when mousing/focusing in our derived GDBG and using Syncfusion 4.4 libraries.

However, I seem to be getting the message box in our overridden OnMouseDown event handler. Nothing terribly significant is happening in our overridden OnMouseDown, but I wonder about another method we're handling: CurrentCellActivating.

It looks like the GridControlBase.OnMouseDown is catching some exception that may have happened in the CurrentCellActivating event or GotFocus event maybe?.
I wish I could see the stack trace of the exception that is the source of that "Don't use method to position" message.

Any ideas?

Loader.
Live Chat Icon For mobile
Up arrow icon