Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > problems getting text from labels in datagrid control

Reply
Thread Tools

problems getting text from labels in datagrid control

 
 
Charles
Guest
Posts: n/a
 
      01-14-2004
I am having some problems with getting the text from a
label inside of a datagrid control. I want to put the
text of the label into an array.

Here is part of the *.aspx file:
<asp:TemplateColumn HeaderText="Last Name">
<ItemTemplate>
<asp:Label id=lblLName runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.LName") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=LName CssClass=grid runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.LName") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>

Just before the EditCommand event I want to get the
current values of all (I have eight, but only show one
here) labels. Right now in my EditCommand event I have:

For I = 1 To e.Item.Cells.Count - 1
Dim label1 As Label = DataGrid1.Items(I).Cells
(0).Controls(1)
CurrentValues(I) = label1.Text
Next

Before this line:

DataGrid1.EditItemIndex = e.Item.ItemIndex

How do I get a text value from a label from a datagrid
control? I want to compare two arrays to find what
information in the grid (edited row) has been changed. I
am not sure if this is a good way, so if there is please
share that with me.

Thanks,
Charles

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"pointlabel"-like function for Python: distribute text labels on a2-d scatter plot to avoid overlapping labels C Barrington-Leigh Python 1 09-12-2010 09:58 PM
Gridview control will not wrap text in ItemTemplate Labels Keithb ASP .Net 0 11-04-2006 12:28 AM
Find footer labels in DataGrid tshad ASP .Net 9 11-17-2004 01:02 AM
Getting the Names/Labels of form fields that are invalid. darrel ASP .Net 1 09-03-2004 05:31 PM
Datagrid info to labels in table Sue ASP .Net 2 10-31-2003 04:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57