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

  • Home
  • SEARCH
  • 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 7945933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:00:18+00:00 2026-06-04T01:00:18+00:00

I have a very annoying problem that I’ve been struggling with for a few

  • 0

I have a very annoying problem that I’ve been struggling with for a few hours now. I have multiple asp.net GridView controls on a page. One of these grids (grid B), is dependent on another grid (grid a) for its data to update correctly.

The problem I have is this:

When I do gridB.Databind() in a if(!IsPostback), then functionality of Grid B works, but the grid doesn’t update with newly added records in Grid A.

When I do gridB.Databind() anywhere else that doesn’t contain a Postback check, then the data in grid B updates correctly with the newly added records in Grid A, but then the functionality of Grid B no longer works.

Example:

            // Functionality for dropdownlist etc works correctly, but new data from gvA doesn't show in gvB
            if (grvSender.ID == "gvA")
            {
                if (!IsPostBack)
                    gvB.DataBind();
            }

            // Functionality for dropdownlist etc no longer works correctly, but new data from gvA shows correctly in gvB
            if (grvSender.ID == "gvA")
            {
                if (IsPostBack)
                    gvB.DataBind();
            }

I’ve called the databind method for gvB in every possible place known to man and the same problem persists…Fix problem A gives me problem B and fixing problem B gives me problem A.

Any ideas would be great. I can see this being something ridiculously silly but I’ve stared at the code almost all day now and I’m out of ideas.

  • 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-06-04T01:00:19+00:00Added an answer on June 4, 2026 at 1:00 am

    You should use Page_PreRender event for your code and you can write your code as follow with else as well.

            if (grvSender.ID == "gvA")
            {
                if (!IsPostBack)
                    gvB.DataBind();
            }
    
            else
            {
                if (IsPostBack)
                    gvB.DataBind();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a layout that is working, but it has one very annoying problem..
I have a very annoying problem that has left me scratching me head when
I have a very annoying problem on the application I've been contracted to work
I've recently started using GNU Screen but have run into a very annoying problem.
i have very simple problem. I need to create model, that represent element of
I have a very annoying problem With my Jquery based ajax live search. The
I have a very annoying problem. I have a mIRC/Skype application, meaning chatroom with
I have a very annoying problem with Struts. The input page is located under
I have a very annoying problem: My project (JSP, Servlet) requires Xerces-J 2.8.1 or
I'm facing a very annoying problem. Here's the context : I have a rectangle

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.