Protected Sub DetailsView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles DetailsView1.ItemUpdating
Dim id As Integer = CInt(DetailsView1.Rows(0).Cells(1).Text)
Dim txt1 As TextBox = DirectCast(DetailsView1.FindControl("TextBoxName"), TextBox)
Dim ddl1 As DropDownList = DirectCast(DetailsView1.FindControl("DropDownListPosition"), DropDownList)
Dim data As New ExampleData()
data.UpdateData(id, txt1.Text, CInt(ddl1.SelectedValue))
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly)
DetailsView1.DataSource = data.GetData(GridView1.DataKeys(GridView1.SelectedIndex).Value)
DetailsView1.DataBind()
GridView1.DataSource = data.GetAllData()
GridView1.DataBind()
End Sub