Datagrid Update Command

Discussion in 'ASP .Net Datagrid Control' started by Greg Biniek, Oct 21, 2004.

  1. Greg Biniek

    Greg Biniek Guest

    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!

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Greg Biniek, Oct 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YWJkb2x5?=

    datagrid update command

    =?Utf-8?B?YWJkb2x5?=, Jun 1, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    6,084
    sobin
    Mar 19, 2005
  2. John Blair

    Datagrid update command - and validators

    John Blair, Jan 24, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    3,261
    vgebrev
    Jan 30, 2008
  3. =?Utf-8?B?TWljaGFlbA==?=

    How to update datagrid after update

    =?Utf-8?B?TWljaGFlbA==?=, Mar 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    525
    Alex D.
    Mar 17, 2006
  4. Andreas Klemt
    Replies:
    0
    Views:
    338
    Andreas Klemt
    Oct 8, 2003
  5. prakash
    Replies:
    2
    Views:
    631
    prakash
    Apr 11, 2005
Loading...

Share This Page