Bindingnavigator,Datagridview,textboxes

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Mar 2008
Posts: 1
Reputation: miss_cindy is an unknown quantity at this point 
Solved Threads: 0
miss_cindy miss_cindy is offline Offline
Newbie Poster

Bindingnavigator,Datagridview,textboxes

 
0
  #1
Mar 15th, 2008
Hy ,

I need help please !
I am developping an application with vb.net and sql server .I have a form containing a datagridview ,textboxes ,bindingsource and bindingnavigator .
I want that the columns of the selectedrow of datagridview appear and change in textboxes when the selectedrow is changed by the bindingnavigator buttons .
This is what i wrote in the my code :

Private Sub gridproduits_RowStateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewRowStateChangedEventArgs) Handles gridproduits.RowStateChanged
TextBox1.Text = gridproduits.SelectedRows(0).Cells(0).Value
TextBox2.Text = gridproduits.SelectedRows(0).Cells(1).Value
TextBox3.Text = gridproduits.SelectedRows(0).Cells(2).Value

End Sub


But it doesn't work ! .It appears an error message :
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC