The problem begins if the field in the table have a value which is not in the list of the dropdown. Especially field which contains null values making problems. 1) Remove the Databinding 2) Fill the value in the rowcreatedevent.The following code is searching for the value in the list and select it.Software architect with over 10 years of proven experience in designing & developing n-tier and web based software applications, for Finance, Telecommunication, Manufacturing, Internet and other Commercial industries.He believes that success depends on one's ability to integrate multiple technologies to solve a simple as well as complicated problem. Microsoft OLE DB Provider for ODBC Drivers (0x80004005) .... With Templatefields it is easy to use a dropdown control for value selection. Command Text = "select .., validate from table" da = New Sql Data Adapter(cmd) da. Red End If Next also check for the header row in rowdatabound event if gridview is having bound filed then it should work, if you are using templates, then you should use find control to find the specific control and then change its value For i = 0 To Grid View1.
3) Save the data You must hook into the saving process with the Rowupdating event.
" End If End Sub Protected Sub grid View_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) grid View. New Edit Index load Stores() End Sub Protected Sub grid View_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) Dim stor_id As String = grid View.
To String() Dim stor_name As Text Box = Direct Cast(grid View.
As you will notice above I am looping through the array and adding a List Item to Array List and finally binding the Array List to the Grid View.
The figure below displays a Grid View populated with 2 dimensional arrays As you will notice for multi dimensional array I am creating a datatable with the same number of columns as in the array and then looping through the array and adding the data to the datatable and finally binding the datatable to the Grid View.