By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,980 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Empty String when accessing DataGrid TextBox

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.