R
Robert Koller
Hello
i have this problem:
In a DataGridView the user work with data from a DataSet. on Start the row
index from datagridview is the same as the row index from the dataset.
Also:
DataGridView.Rows(5) <=====> DataSet.Rows(5) .
if the user delete a row (without update), or the user sort the datagridview
the index in the datagridview change but not the index in the dataset.
do you can help me to find the dataset index from the datagridview index?
my Example:
Private Sub KRKostenArtikelgruppenDataGridView_RowLeave(ByVal sender As
Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
KRKostenArtikelgruppenDataGridView.RowLeave
If Me.Validate Then
Me.KRKostenArtikelgruppenBindingSource.EndEdit()
If Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).RowState
= Data.DataRowState.Added Or
Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).RowState =
Data.DataRowState.Modified Then
Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).Item("GebuchtDatum")
= Now()
Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).Item("GebuchtPerson")
= PersonenNummer
End If
End If
End Sub
This example don't work correct with sorted datagridview or after delete a
row.
Sorry for my english ;-) and thank you for our support!
Robert Koller
i have this problem:
In a DataGridView the user work with data from a DataSet. on Start the row
index from datagridview is the same as the row index from the dataset.
Also:
DataGridView.Rows(5) <=====> DataSet.Rows(5) .
if the user delete a row (without update), or the user sort the datagridview
the index in the datagridview change but not the index in the dataset.
do you can help me to find the dataset index from the datagridview index?
my Example:
Private Sub KRKostenArtikelgruppenDataGridView_RowLeave(ByVal sender As
Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
KRKostenArtikelgruppenDataGridView.RowLeave
If Me.Validate Then
Me.KRKostenArtikelgruppenBindingSource.EndEdit()
If Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).RowState
= Data.DataRowState.Added Or
Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).RowState =
Data.DataRowState.Modified Then
Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).Item("GebuchtDatum")
= Now()
Me.KenusDBDS.KRKostenArtikelgruppen.Rows(e.RowIndex).Item("GebuchtPerson")
= PersonenNummer
End If
End If
End Sub
This example don't work correct with sorted datagridview or after delete a
row.
Sorry for my english ;-) and thank you for our support!
Robert Koller