473,395 Members | 1,474 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.

Iterating through a Repeater Control - Loosing my mind...

Dim i As Integer

Dim Collected1 As TextBox

For i = 0 To (Grid.Items.Count - 1)

Collected1 = CType(Grid.Items(i).FindControl("COLLECTED"), TextBox)

Response.Write(Collected1.Text)

Next

This doesn't work and prints nothing even though data is in the textbox.
Any ideas - this is driving me mad...

Jul 27 '07 #1
1 1417
Hi,
Try this code:
foreach (GridViewRow row in GridView1.Rows)
{

// Selects the text from the TextBox which is inside the GridView control

string textBoxText = ((TextBox)row.FindControl("TextBox1")).Text;

Response.Write(textBoxText);

}
Although the above code is in C# you can easily convert it to VB.NET
Whenever i have query regarding gridview i refer site
http://gridviewguy.com/CategoryDetai...x?categoryID=7
--
Hope this answers your question.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Ryan Smith" wrote:
Dim i As Integer

Dim Collected1 As TextBox

For i = 0 To (Grid.Items.Count - 1)

Collected1 = CType(Grid.Items(i).FindControl("COLLECTED"), TextBox)

Response.Write(Collected1.Text)

Next

This doesn't work and prints nothing even though data is in the textbox.
Any ideas - this is driving me mad...
Jul 27 '07 #2

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

Similar topics

1
by: Mark Fox | last post by:
Hello, I have a repeater and in each itemtemplate I have a radiobuttonlist. I am attempting to figure out how on postback I could iterate through the rows displayed by the repeater and for...
3
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%#...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
1
by: Daves | last post by:
I'm listing photos of people, a total of 30-50. The images are listed as "cubes inside a box" (don't know how to explain better!) that is 5x5 6x6 7x10 or whatever the size of the image is....
6
by: Ken Fine | last post by:
I'm using SQLDataSource, which generates some kind of dataset, and then I attach that datasource to various data display controls such as DataList and repeater which loop through to the end of the...
2
by: bissatch | last post by:
Hi, I am trying to output a list of checkboxes. Using ASP .NET controls, I was able to create the following: <label for="colour_red">Red: </label><asp:CheckBox ID="colour_red" runat="server"...
5
by: Brad Baker | last post by:
I am trying to make a "tabbed" interface by iterating through a dataset with a conditional statement. For example: ...
2
by: Jeff | last post by:
Hey ASP.NET 2.0 GridView have AllowPaging & PageSize for the letting the GridView span multiple pages. But is the same allowed on a Repeater control? I didn't see any properties like...
4
by: adiel_g | last post by:
I am trying to loop through a repeater to retrieve a dataitem field but am getting a NullReferenceException. I can find a checkbox control but cannot find a dataitem field. Here is the code that...
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:
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.