2014 m. sausio 22 d., trečiadienis

GridView: RowUpdating



 Protected Sub gvMainGroups_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gvMainGroups.RowUpdating

        Dim iID As Integer = e.Keys(0)

        Dim oGridRow = gvMainGroups.Rows(gvMainGroups.EditIndex)

        Dim srtOrd As TextBox = oGridRow.FindControl("tbSortOrder")

        Dim obj = (From mg In odb.MainGroups Where mg.Id = iID).First

        obj.ProductGroup = e.NewValues("ProductGroup").ToString.Trim
        obj.SortOrder = If(srtOrd.Text.Trim <> "", CInt(srtOrd.Text.Trim), CInt(1))

        odb.SubmitChanges()

        gvMainGroups.EditIndex = -1
        bind()
    End Sub



Komentarų nėra:

Rašyti komentarą