473,320 Members | 2,094 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,320 software developers and data experts.

Empty String when accessing DataGrid TextBox

I'm using VB.Net and trying to retrieve the data in the textboxcell of a datagrid after a successful display (used Databind).User can either display data or enter data in the textbox. I canalways get the textbox object using either the Controls orFindControl method but it's always returning an empty *.Textinstead of the value displayed on the screen. Below are snippetsof my code - anybody there who can help me PLEASE?

=====*.vb

<edit mode turned on>

For i = 0 To mhRcptIndex - 1
srcLotNumber =Trim(UCase(CType(RcptLotInfoGrid.Items(i).Cells(1 ).Controls(1),TextBox).Text)) ==> empty string

or

srcLotNumber =Trim(UCase(CType(RcptLotInfoGrid.Items(i).Cells(1 ).FindControl("txtInvLotNumber"), TextBox).Text)) ==> empty string

=====*.aspx

<asp:TemplateColumn HeaderText="LOT NUMBER">
<ItemTemplate>
<asp:TextBox id="lblInvLotNumber" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "InvLotNumber") %>'>
</asp:TextBox>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtInvLotNumber" runat="server"CssClass="Input" Text='<%# DataBinder.Eval(Container.DataItem,"InvLotNumber") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>

--------------------------------
From: Tetet B

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>mCmNJzVu6kSruvpotnXMcA==</Id>
Jul 21 '05 #1
0 1470

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

Similar topics

1
by: lozd | last post by:
Hi, Could anyone help me with the syntax (if there is any) for manipulating Datagrids in JavaScript. Basically I've built a datagrid with a textbox and an asp "lookup" button. The user needs...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
3
by: Simon Prince | last post by:
Hi, I'm trying detect an empty cell in a datagrid when the content is posted back to the server. My code is... Dim vDgi_GridItem As DataGridItem For Each vDgi_GridItem In...
0
by: Tetet B via .NET 247 | last post by:
I'm using VB.Net and trying to retrieve the data in the textboxcell of a datagrid after a successful display (used Databind).User can either display data or enter data in the textbox. I canalways get...
1
by: lgalumbres | last post by:
Hi, I have a datagrid on Winform that is bound to a datatable. In essence, what I would like to do is that when a user inputs a number into a textbox control for example 5 then 5 empty rows...
18
by: Academia | last post by:
I let the use modify the text of a combobox and then I replace the selected item with the new text (in Keyup event). But if he sets the Text property to an empty string ("") that sets the...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.