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.

GridDataBoundGrid..exception after cell edit lost focus.

Thread ID:

Created:

Updated:

Platform:

Replies:

60174 Apr 29,2007 02:34 PM May 16,2007 08:18 PM Windows Forms 2
loading
Tags: GridControl
Santosh
Asked On April 29, 2007 02:34 PM

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?

haneefm [Syncfusion]
Replied On April 30, 2007 02:12 PM

Hi Santosh,

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

Best regards,
Haneef

Mark Atkinson
Replied On May 16, 2007 08:18 PM

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?

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.

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.

;