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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Cell changing the Focus on rowleave

Thread ID:





6725 Aug 25,2003 10:13 AM UTC Aug 25,2003 01:06 PM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On August 25, 2003 10:13 AM UTC

Dim cc As GridCurrentCell = Me.gceProduct.CurrentCell If Val(gceProduct.Model(cc.RowIndex, SPEC_MINIMUM).Text.Trim) > Val(gceProduct.Model(cc.RowIndex, SPEC_MAXIMUM).Text.Trim) Then msgbox("Minimum can't be greater than Maximum") e.Cancel = True Exit Sub End If Hi Clay, The above is the code in my grid rowleave event. I am validating two columns and giving the error message on the rowleave event. I want to set the focus to particular cell of the row if this condition satisfies. I tried this code... (before exit sub) gceProduct.CurrentCell.MoveTo(gceProduct.CurrentCell.RowIndex, SPEC_MINIMUM, GridSetCurrentCellOptions.ScrollInView) It is throwing error as : " Deactivate called while the current cell was in process of activating or deactivating a cell" How can i solve it.. Regards, saravanakumar

Administrator [Syncfusion]
Replied On August 25, 2003 01:06 PM UTC

In addition to handling RowLeave, also handle ValidatedFailed, and move the current cell there. You cannot move the currentcell from within RowLeave as at that point, the grid is in the middle of a currentcell move. AddHandler Me.gridDataBoundGrid1.ValidateFailed, AddressOf grid_ValidateFailed Private Sub grid_ValidateFailed(sender As Object, e As GridValidateFailedEventArgs) Dim cc As GridCurrentCell = Me.gridDataBoundGrid1.CurrentCell Me.gridDataBoundGrid1.CurrentCell.MoveTo(cc.RowIndex, 1, GridSetCurrentCellOptions.SetFocus) End Sub 'grid_ValidateFailed


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon