Code for rowupdating event in gridview

Uncheck Auto-Generate Field from the Property window.

Everyone using Row Editing event handler by using findcontrol method and editindex number. Name Brand" & " FROM Product P, Brand B" & " WHERE P. ID" Dim s Constr As String = Configuration Manager. Connection String Using conn As New Sql Connection(s Constr) Using comm As New Sql Command(SQL, conn) conn. Data Bind() End Sub 0 Then Dim cbo Brand As Drop Down List = Direct Cast(e. Find Control("cbo Brand"), Drop Down List) Dim dt As Data Table Dim SQL As [String] = "SELECT * FROM Brand" Dim s Constr As String = Configuration Manager. Connection String Using conn As New Sql Connection(s Constr) Using comm As New Sql Command(SQL, conn) conn.

It is returning data from a stored procedure without a problem.

I am having trouble Editing, Deleting the records from the Gridview as my application keeps erroring out at the Row Editing event.

But there is an alternative, we can reference the above controls within Grid View edit mode in Pre Render method which is best i think. Open() Using da As New Sql Data Adapter(comm) dt = New Data Table("tbl") da. Open() Using da As New Sql Data Adapter(comm) dt = New Data Table("tbl") da.

In Pre Render method we can access each edit template controls so that we can easily hide or show or enable or disable those controls.

188

Leave a Reply