The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
well I'm from Switzerland, so my english isn't very good.
So, I've a problem.
I'm looping through all the Rows in a DataTable to control the values of the cells. If a value isn't correct I want to apport and set the focus on this cell. Well I allready found the function "
My code looks like that: (I deleted many things, but you don't have to care about the rest)
---code--- Private Function ValidateRapportPos(ByVal oGrid As Syncfusion.Windows.Forms.grid.GridDataBoundGrid) As Boolean Dim oRow As DataRow Dim oDataTable As New DataTable 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)
ADAdministrator 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?
ADAdministrator 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)