Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:49:47+00:00 2026-05-26T20:49:47+00:00

I have a Repeater nested inside of a GridView . On the RowDataBound event

  • 0

I have a Repeater nested inside of a GridView. On the RowDataBound event for the GridView, I set the DataSource (based on one of the row’s columns) and then bind the Repeater. This works fine for the initial load, however I need to be able to add new items to the Repeater dynamically.

I append an item to the DataSource, save it to the ViewState, and where I would normally bind using a method call, I bind to the object saved to the ViewState instead. The DataSouce reflects the change, however the page does not.

What am I missing? I have the exact same setup on another page without the nesting and it works perfectly.

if (ViewState["RepeaterObj"]!=null)
{
   rpt.DataSource=(IList<DataTransferObject>)ViewState["RepeaterObj"];
}
else
{
   rpt.DataSource = controller.GetObj(param);
   rpt.DataBind();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:49:48+00:00Added an answer on May 26, 2026 at 8:49 pm

    I ended up resolving the question by cutting out use of the ViewState entirely, though I thought my temporary DataSource would be lost across the postback it wasn’t. I ended up going with a class-level variable which works perfectly. It seems I didn’t properly understand what happens during a postback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two repeater which are nested..Means there is one repeater and inside that
I have a user control nested in a repeater. Inside my user control I
Say I have a Form View with a Repeater inside of it, and then
I have a nested repeater set up but the child repeater control is not
I've got a Repeater and its SqlDatasource nested inside a Gridview TemplatedField. The Repeater's
I have a gridview nested within a repeater, and I'm trying to enable paging
I have a gridview control nested within a repeater control. The repeater control is
I have a nested repeater control. Here is what the HTML looks like: <ItemTemplate>
I have a nested Repeater control in the ItemTemplate of another Repeater. I want
I have a repeater bind by the data coming from database. Now on click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.