J
James
I have a GridView where I have added a DropDownList control that is bound to
a field in the GridView.
I want to be able to set the dropdown for each row in the gridview then
update the rows on the submit (button_click).
I have the following code for the button_click. The problem I'm having is
that "DropDownListSeries" is not declared. I need to know how to use that in
the button_click function.
Any help would be GREATLY appreciated!
Imports System.Data.SqlClient
Partial Class members_members_lineups
Inherits System.Web.UI.Page
Protected Sub ButtonSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ButtonSubmit.Click
Dim driverID As Integer
Dim teamID As Integer
Dim Series As String
Dim row As GridViewRow
For Each row In GridViewLineup.Rows
driverID = row.Cells(4).Text
teamID = row.Cells(5).Text
Series = DropDownListSeries.SelectedValue
Dim sql = "UPDATE tblRosters SET series='" & Series & "' WHERE driverID=" &
driverID
SqlDataSource_Rosters.UpdateCommand = sql
SqlDataSource_Rosters.Update()
Next
GridViewLineup.DataBind()
End Sub
End Class
a field in the GridView.
I want to be able to set the dropdown for each row in the gridview then
update the rows on the submit (button_click).
I have the following code for the button_click. The problem I'm having is
that "DropDownListSeries" is not declared. I need to know how to use that in
the button_click function.
Any help would be GREATLY appreciated!
Imports System.Data.SqlClient
Partial Class members_members_lineups
Inherits System.Web.UI.Page
Protected Sub ButtonSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ButtonSubmit.Click
Dim driverID As Integer
Dim teamID As Integer
Dim Series As String
Dim row As GridViewRow
For Each row In GridViewLineup.Rows
driverID = row.Cells(4).Text
teamID = row.Cells(5).Text
Series = DropDownListSeries.SelectedValue
Dim sql = "UPDATE tblRosters SET series='" & Series & "' WHERE driverID=" &
driverID
SqlDataSource_Rosters.UpdateCommand = sql
SqlDataSource_Rosters.Update()
Next
GridViewLineup.DataBind()
End Sub
End Class