| | |
Bindingnavigator,Datagridview,textboxes
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Mar 2008
Posts: 1
Reputation:
Solved Threads: 0
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
,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
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Input from textbox!!
- Next Thread: help regarding timer
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account application array basic beginner browser button buttons center check click code combo crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel exists fade file-dialog filter forms ftp generatetags hardcopy html images input insert intel listview module monitor net networking number open output panel passingparameters picturebox picturebox2 port print printing problem project regex right-to-left searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey tcp temperature text textbox timespan toolbox transparency trim txttoxmlconverter user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





