VB 2005 Row index in datagridview <> row index in dataset

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
 
P

Peter Huang [MSFT]

Hi Robert,

Since VS.NET 2005(Whidbey) has not been released, so far for Whidbey issue,
we have a definitely newsgroup about Whidbey.
microsoft.beta.whidbey.*

Thanks for your understanding!


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Robert Koller

Hi Peter

Thank you for your response.

Unfortunatly i can't fin this newsgroup
Since VS.NET 2005(Whidbey) has not been released, so far for Whidbey
issue,
we have a definitely newsgroup about Whidbey.
microsoft.beta.whidbey.*

You are sure?

Thank you verry match.

Robert
 
P

Peter Huang [MSFT]

Hi

I am sorry for my mistake, I did not notice that has been closed.
And thanks for Herfried's correction, so far you can post to the link as
Herfried suggest.

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top