Click here to Skip to main content
15,916,432 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a repeater, which basically has a text box in it and I have implemented a paging function on the repeater, the repeater only shows 25 rows at a time. What I want to do is, get each text box for each row in the repeater, but at the moment I am only getting the text boxes that are shown on the repeater (the first 25 rows). What can I change in my code to get every single row?

My code is as follows:

C#
foreach (Control control in repeaterSegmentList.Controls)
                {
                    foreach (Control innerControl in control.Controls)
                    {
                        if (innerControl.ID != null)
                        {

                            if (innerControl.ID == "Priority")
                            {
                                ((TextBox)innerControl).Text = txtPrio.Text;
                            }
                        }
                    }
                }
Posted
Comments
CodingLover 6-Oct-11 12:16pm    
You mean that you cannot see the textbox in other pages? If so, did you implement the page index changed event?

1 solution

If I understand, you have a datasource with 25+ items in it which you have bound to a Repeater that will show 25 rows at a time? Now you want to get the TextBox for rows 26 and beyond? Correct?

That being the case, you can't. ASP.NET will only render 25 rows at a time. The only way to stop this is to not use paging and display all rows in the datasource, which could be very large making the page slow and cumbersome for the user.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900