473,395 Members | 1,891 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,395 software developers and data experts.

Retrieving text from DataList cells

I need to build a string from the content of a datalist containing a nested
datagrid.
This properly returns the data from the first cell in the datagrid:
String first = GridItem.Cells[0].Text;

However, I can't seem to apply the same technique to the datalist as ³Cells²
is not implemented. How does one retrieve the text from a datalist cell
then?
Thanks,
Stephan.
Nov 18 '05 #1
1 1774
If you know it is the first control in the list, you could:
CType(e.item.Controls(0), TextBox).Text()
or loop through all controls
Dim i As Integer
For i = 0 To e.Item.Controls.Count - 1
If TypeOf e.Item.Controls(i) Is Textbox Then
CType(e.item.Controls(i), TextBox).Text()
End If
Next

Bin Song, MCP
-----Original Message-----
I need to build a string from the content of a datalist containing a nesteddatagrid.
This properly returns the data from the first cell in the datagrid:String first = GridItem.Cells[0].Text;

However, I can't seem to apply the same technique to the datalist as ³Cells²is not implemented. How does one retrieve the text from a datalist cellthen?
Thanks,
Stephan.

Nov 18 '05 #2

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

Similar topics

1
by: KavvY | last post by:
Hello, I have managed to get to a point where clicking on the update button retrieves the fields which are updated ok, but the field that contains the key and is hidden is proving to be...
0
by: Bryan Donaldson | last post by:
I have a table on my web form, declared like this: <asp:table id="tblOverrides" runat="server" enableviewstate=true" cssclass="clsTable"> <asp:tablerow cssclass="clsTblHeader"> <asp:tablecell ...
5
by: Ryan Moore | last post by:
I am trying to modify the onMouseOver attribute of a <td> cell created by a DataList... according to ...
2
by: alan | last post by:
Hi All, I have a DataList, how can I retrieve all the items in the datalist? eg. for (int i=0; i < DataList.Item.Count; i++) MyArray = DataList.Item.xxxxx.?? Thanks a lot!
1
by: Nathan Sokalski | last post by:
I have a DataList with a RepeatColumns property that has a value of 3. However, when the number of items is not divisible by 3, I have blank cells at the end of the list, which makes the DataList...
3
by: GD | last post by:
I'm using a DataList and a Repeater (nested in the DataList) to display a list of "Chapters" and "Documents" within the Chapters. <asp:DataList ID="dlChapter" Runat="server" RepeatColumns="2"...
2
by: Iain | last post by:
Hi All Using Delphi 2006 developer - C# Project I have the following 2 event handlers for the datagrid - see botton of page Both events will fire off correctly but i have a problem collecting...
2
by: 4Ankit | last post by:
hello all, i am having some difficulty retrieving information from my form. I want to add content in my table but the content i want to add to the table is what the user inputs in my form. ...
1
by: rishiyo | last post by:
Good ones!! I want to retrieve and add datas with excel. I've tried one by adding two textboxes and two command buttons. THE code is: 'do declare these variables you need to add a reference'to...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.