AD
Administrator
Syncfusion Team
March 21, 2007 12:51 PM UTC
oh... there's a little mistake, it's quite difficult to write code in here... :)
'Here i want to set the focus to the cell: oRow(enColsGrd.Bezeichnung)
oGrid.CurrentCell.MoveTo(???, enColsGrd.Bezeichnung)
??? = RowIndex, but how can I get it, out of oRow?
AD
Administrator
Syncfusion Team
March 21, 2007 07:55 PM UTC
Hi Peter,
Use the Binder.ListManagerPositionToRowIndex method to find a zero-based position of the data source displayed in the grid to an absolute row index in the grid. You can try the below code snippet to find a rowindex.
---code---
Private Function ValidateRapportPos(ByVal oGrid As Syncfusion.Windows.Forms.grid.GridDataBoundGrid) As Boolean
Dim oRow As DataRow
Dim oDataTable As New DataTable
Dim iPosition As Integer = 0
oDataTable = m_RppStunden
For Each oRow In oDataTable.Rows
If oRow(enColsGrd.Bezeichnung) <= 0 Then
m_sMsg = "error! bla bla bla!"
'Here i want to set the focus to the cell: oRow(enColsGrd.Bezeichnung) oGrid.CurrentCell.MoveTo(, enColsGrd.Bezeichnung)
Dim iRowIndex As Integer = oGrid.Binder.ListManagerPositionToRowIndex(iPosition)
oGrid.CurrentCell.MoveTo( iRowIndex , enColsGrd.Bezeichnung)
Return False
End If
iPosition ++
Next
---code---
Best Regards,
Haneef