473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can't retrieve updated fields from Datagrid

I'm new to ASP.NET and I'm trying to create an aspx page that retrieves info
from a database, let's the user make a change and write the change back. It
reads from the database just fine. The problem lies when you try to edit a
field. The change doesn't get passed back to the vb code. Here are code
fragments of what I'm trying to do:

Here is a part of the HTML dealing with one field...

<asp:TemplateColumn HeaderText="Reg Clerk">
<ItemStyle Wrap="False" HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:Label Runat=server text='<%# Container.DataItem("RegClerk")%>'
id="Label75">
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox Enabled=True Width=50 CssClass="text" Runat="server"
ID="txtRegClerk" Text='<%# Container.DataItem("RegClerk")%>' Wrap="false">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>

Here is the vb code that tries to retrieve the edited value in "RegClerk":

Dim RegClerk As String =
CType(Me.DataGrid1.Items(e.Item.ItemIndex).FindCon trol("txtRegClerk"),
TextBox).Text

If there's already a value in the field, the original value comes through
OK. If you edit it, only the original value seems to be passed.

What am I missing?

Thanks,
Mark


Nov 22 '05 #1
0 1073

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Kaku | last post by:
I'm trying to retrieve a text value from a MySQL database, put it into an updateable form, allow edits, and send back the edited text back into the MySQL database. I've been able to successfully...
0
by: Mark Brown | last post by:
I'm new to ASP.NET and I'm trying to create an aspx page that retrieves info from a database, let's the user make a change and write the change back. It reads from the database just fine. The...
1
by: Jason Shohet | last post by:
We have some db-search functionality that we need in several asp.net apps. How to get reuse out of this... I was thinking of putting the search criteria, and the datagrid that displays the...
1
by: Linda | last post by:
Hi, I'm new to asp.net and tryign to learn how to work with data grids. I'm retrieving data from a stored procedure and putting it in a data grid. I then want to be able to sort the data when...
1
by: headbig003 | last post by:
Hello I put template column in datagrid. Below is the html code I used. <asp:datagrid id="dgAnswer" runat="server" Width="360px" AutoGenerateColumns="False" DataKeyField="ansID"> <Columns>...
3
by: MaryA | last post by:
I have an asp.net application in which i have a form containing a datagrid when using the update command event i have: tb = CType(e.Item.Cells(3).Controls(0), TextBox) subject = tb.Text this code...
0
by: Tuomo | last post by:
Hi! I have a form (System.Web.UI.Page) that contains a DataGrid control and a DataTable that contains values for the data grid and that is data bound to the DataGrid. When I switch the grid to...
1
by: .net_developer | last post by:
Hi I have a datagrid that has the following fields.. 1.Document Title - Bound Column 2.Document Date-Bound Column 3.Save to Computer- Template Column-Link Button I need to retrieve the...
8
by: mlwerth | last post by:
Dear Access Group: This is the most basic and most embarrassing of questions, but I cannot find where to change the data type of a text field that I have in Access 2003 to a number field. I've...
1
by: divya | last post by:
Hello, I used the below code to move selected items between two listboxes Left and Right:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPopup.aspx.cs" Inherits="TestPopup" %> ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.