G
Greg Biniek
Any help PLEASE! I have a datagrid on a aspx page. The editcommand and
cancelcommand work as explected however my updatecommand is not. My
problem is that when I reference the textbox on the record that was
edited I get the unedited value in the code.
Private Sub dgInkColor_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgInkColor.UpdateCommand
**************************************************
*THE IMMEDIATE 3 LINES BELOW RETURN THE UN-EDITED
*VALUE. EXAMPLE... IF THE RECORD IN THE DB WAS
*'TEST', I CLICKED THE EDIT LINK, CHANGED THE VALUE
*TO 'SECOND VALUE', CLICK THE UPDATE LINK (WHICH
*RUNS THIS CODE), I GET A VALUE OF 'TEST'... WHAT
*IS HAPPENING HERE
**************************************************
Dim iSeriesValue As String = CType(e.Item.Cells(3).Controls(0),
TextBox).Text
Dim PressValue As String = CType(e.Item.Cells(4).Controls(0),
TextBox).Text
Dim PrintValue As String = CType(e.Item.Cells(5).Controls(0),
TextBox).Text
Dim Id As Int16 = e.Item.Cells(2).Text
Dim dr As dsInkColor.usp_InkColorTable_SelectRow
dr = DsInkColor1.usp_InkColorTable_Select.FindByColorNum(Id)
dr.iSeriesColor = iSeriesValue.Trim
dr.PrintColor = PrintValue
dr.PressColor = PressValue
daInkColor.Update(DsInkColor1)
dgInkColor.EditItemIndex = -1
dgInkColor.DataBind()
End Sub
Any help PLEASE!!! Thanks!
cancelcommand work as explected however my updatecommand is not. My
problem is that when I reference the textbox on the record that was
edited I get the unedited value in the code.
Private Sub dgInkColor_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgInkColor.UpdateCommand
**************************************************
*THE IMMEDIATE 3 LINES BELOW RETURN THE UN-EDITED
*VALUE. EXAMPLE... IF THE RECORD IN THE DB WAS
*'TEST', I CLICKED THE EDIT LINK, CHANGED THE VALUE
*TO 'SECOND VALUE', CLICK THE UPDATE LINK (WHICH
*RUNS THIS CODE), I GET A VALUE OF 'TEST'... WHAT
*IS HAPPENING HERE
**************************************************
Dim iSeriesValue As String = CType(e.Item.Cells(3).Controls(0),
TextBox).Text
Dim PressValue As String = CType(e.Item.Cells(4).Controls(0),
TextBox).Text
Dim PrintValue As String = CType(e.Item.Cells(5).Controls(0),
TextBox).Text
Dim Id As Int16 = e.Item.Cells(2).Text
Dim dr As dsInkColor.usp_InkColorTable_SelectRow
dr = DsInkColor1.usp_InkColorTable_Select.FindByColorNum(Id)
dr.iSeriesColor = iSeriesValue.Trim
dr.PrintColor = PrintValue
dr.PressColor = PressValue
daInkColor.Update(DsInkColor1)
dgInkColor.EditItemIndex = -1
dgInkColor.DataBind()
End Sub
Any help PLEASE!!! Thanks!