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

grid.CurrentCell.MoveTo problem in async mode

Thread ID:

Created:

Updated:

Platform:

Replies:

26734 Mar 31,2005 12:36 AM UTC Mar 31,2005 11:17 AM UTC Windows Forms 4
loading
Tags: GridControl
I Gusti Ngurah Wirawan
Asked On March 31, 2005 12:36 AM UTC

In async mode i call grid.CurrentCell.MoveTo and it work but child grid never change. it still display the last selected row.

Administrator [Syncfusion]
Replied On March 31, 2005 01:03 AM UTC

How is grid related to child grid? Are these two GridDataBoundGrids with a parent child relation? Or, are they two GridGroupingControls with a parent child relation? Or are they something else? What do you mean by async mode? Can you post some code snippets showing what you are doing? Or upload a sample project showing the problem you are having?

I Gusti Ngurah Wirawan
Replied On March 31, 2005 01:16 AM UTC

i use two GridDataBoundGrids with parent child relation. the example is like this : protected void MoveTo(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc) { MoveTo(jltaGridDataBound, oDv, oDr, oDc, false); } /// /// To move cursor to a cell of Grid, the method must be invoked /// async to prevent error. /// protected void MoveTo(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc, bool bIsAsync) { if (jltaGridDataBound.CurrentCell.IsInActiveOrDeactivate || bIsAsync) { MoveToHandler oMoveTo = new MoveToHandler(MoveToInvoker); oMoveTo.BeginInvoke(jltaGridDataBound, oDv, oDr, oDc, new AsyncCallback(MoveToCallback), oMoveTo); } else { MoveToMethod(jltaGridDataBound, oDv, oDr, oDc); } } private delegate void MoveToHandler(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc); private void MoveToInvoker(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc) { Invoke(new MoveToHandler(MoveToMethod), new object[] {jltaGridDataBound, oDv, oDr, oDc}); } private void MoveToCallback(IAsyncResult ar) { MoveToHandler oMoveTo = (MoveToHandler)ar.AsyncState; oMoveTo.EndInvoke(ar); } private void MoveToMethod(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc) { try { SetIsInMoveTo(oDv, true); jltaGridDataBound.Focus(); int nPosition = oDv.Find(GetDataRowKeysByDataViewSorts(oDv, oDr)); int nRowIndex = jltaGridDataBound.Binder.PositionToRowIndex(nPosition); int nColIndex = jltaGridDataBound.NameToColIndex(oDc.ColumnName); jltaGridDataBound.CurrentCell.MoveTo(nRowIndex, nColIndex, GridSetCurrentCellOptions.ScrollInView | GridSetCurrentCellOptions.SetFocus); jltaGridDataBound.Refresh(); } catch (System.Exception e) { HandleException(e); } finally { SetIsInMoveTo(oDv, false); } i call MoveTo(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc)function and make MoveToMethod(JLTAGridDataBound jltaGridDataBound, DataView oDv, DataRow oDr, DataColumn oDc) function in async mode. when i call the grid.CurrentCell.MoveTo in those function it select the row but item in child grid still same with last selected row.

I Gusti Ngurah Wirawan
Replied On March 31, 2005 10:01 AM UTC

its kind like this, 1. when i call MoveToMethod directly the current cell point the right place and items in child grid are correct and not active but row that are selected differ 2. when i use async mode that call MoveTo function the selected row is correct with the current cell but items in child grid are differ.

Administrator [Syncfusion]
Replied On March 31, 2005 11:17 AM UTC

In 1), do you see an exception listed in your output window when you try this call? If all that is wrong with 1 is that the current row is not selected, you can try calling grid.Selections.SelectRange(GridRangeInfo.Row(grid.CurrentCell.RowIndex), true); after moving the current cell.

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.

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

;