0

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:

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;
                            }                           
                        }
                    }
                }

thanks in advance.

1 Answer 1

2

You probably want to get a reference to the datasource that you bound to your repeater. It's not useful to get references to textboxes that aren't rendered; they wouldn't contain anything.

The data that you bind to your control has all the records, the representation of the data on the screen will only have the controls necessary to show the 25 rows in your page.

Sign up to request clarification or add additional context in comments.

1 Comment

@johnnie I would, but I don't know how you get the data and how do you bind it to your repeater. You did not provide those details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.