Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 22nd, 2004, 01:38 AM
Registered User
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rotsey
Default Editing in Datagrid with ASP.NET


I am copying an example from a wrox book to learn editing in datagrid

When I refer to the textbox controls that the user as edited in my event handler I am not getting the edited text but the original values before editing.

Here is my event handler

    Public Sub DoItemUpdate(ByVal objSource As Object, ByVal objArgs As DataGridCommandEventArgs)

        Dim objF, objL, objC As TextBox

        objF = CType(objArgs.Item.FindControl("txtFirstName"), TextBox)
        objL = CType(objArgs.Item.FindControl("txtLastName"), TextBox)
        objC = CType(objArgs.Item.FindControl("txtCity"), TextBox)

        Dim strSQL As String
        strSQL = "UPDATE Employees SET FirstName = '" & objF.Text & "',"
        strSQL += " Lastname = '" & objL.Text & "',"
        strSQL += " City = '" & objC.Text & "'"
        strSQL += " WHERE EmployeeID = " & MyDataGrid.DataKeys(objArgs.Item.ItemIndex)

        MyDataGrid.EditItemIndex = -1

    End Sub

Can anyone suggest why this is so?

Btw when I enbable tracing I can see the controls with there new values.


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP(C#) : datagrid editing - alert problem shazia1 VS.NET 2002/2003 0 July 4th, 2005 03:34 AM
Online editing in asp.net bneeraj General .NET 0 February 3rd, 2005 09:32 AM
Editing SINGLE record in ASP.NET Koofmich ADO.NET 5 December 30th, 2004 05:42 AM
Editing 3 Dimensional data in ASP.NET francislang General .NET 5 October 6th, 2004 04:51 AM
Text Editing/Modification in VB.Net/ASP.Net joevnvdvc VS.NET 2002/2003 0 July 29th, 2003 12:56 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.