Hi Supriya,
Thank you for your interest in Syncfusion products.
If you
want to set the CurrentCell focus based on your needed validation, you can use MoveTo method to set the CurrentCell
position. Using that method, you can provide your needed RowIndex and ColumnIndex
and you can set current cell activation property to SetFocus. Please make use of below code and please find the
attached sample,
Code Snippet:
Private Sub gridGroupingControl1_TableControlCurrentCellEditingComplete(ByVal sender As Object, ByVal e As GridTableControlEventArgs)
If (e.TableControl.TableDescriptor.Columns((e.TableControl.CurrentCell.ColIndex - 2)).Name = "parentID") Then
If (Integer.Parse(e.TableControl.Model(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex).Text) > 10) Then
e.TableControl.Model(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex).Text = "0"
e.TableControl.CurrentCell.MoveTo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex, GridSetCurrentCellOptions.SetFocus)
MessageBox.Show("The ParentID column value should be less than 10")
End If
End If
End Sub
Note:
In
the below sample, if you change the value in parentID column(greater than
10), the message box will be shown and then immediately CurrentCell will be focused.
Please
let me know if you have any concerns.
Regards,
Neelakandan
Attachment:
Sample_CurrentCell_SetFocus_VB_e0fd22ef.zip