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 9017343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:14:58+00:00 2026-06-16T04:14:58+00:00

I have a main page with a Gridview that shows data from a Database.

  • 0

I have a main page with a Gridview that shows data from a Database. In the gridview there is a button, when this button is clicked a Dialog will appear allowing u to edit the selected row. The dialog is created as an aspx class. When i edit the data and close down the dialog i want to refresh my GridView on the Main page so the edited data is represented. How can i do this?

my code for editing the data and closing down the dialog is this:

 protected void editButton_Click(object sender, EventArgs e)
        {
            string alias = Request.QueryString["alias"];
            string custid = Request.QueryString["custid"];
            controller.EditDeliveries(custid, alias, tdaysField.Text, thoursField.Text, ttypeField.Text, pdaysField.Text, phoursField.Text, ptypeField.Text);
            ClientScript.RegisterClientScriptBlock(GetType(), "onUpload", "<script type='text/javascript'> window.close();</script>");
        }

Can anyone help ?
And if u need to see more code please tell me.

  • 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-16T04:14:59+00:00Added an answer on June 16, 2026 at 4:14 am

    Just set your datasource again and rebind it in the postback

       gvMyGrid.DataSource = myData; //Fresh from the database
       gvMyGrid.DataBind();          //Bam, fresh data
    

    Edit: Oh and if it’s another Control that is the source of the postback, you can use a Bubble Event to trigger the refresh.

    Second Edit: To have the Dialog Page tell the Main Page to update that grid:

        RaiseBubbleEvent(this, new CommandEventArgs("DataUpdated", "This could be null, or I could be a message to let the user know things are updated")); 
    

    Then on your main Page

       protected override bool OnBubbleEvent(object sender, EventArgs e)
        {
    
            if (e is CommandEventArgs)
            {
                var args = (CommandEventArgs)e;
                //Could use args.CommandArgument here
                switch(args.CommandName)
                {
                      case "DataUpdated":
    
                         gvMyGrid.DataSource = myData; 
                         gvMyGrid.DataBind();          
                         return true;                  //Handled the event LIKE A BOSS
                }
            }
            return false;                              //I didn't handle this event
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Idea I have a main PHP page that loads content in DIV's from
I have a jQuery dialog that pops up when a button is pressed. There
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I have an application that it's main page is organized like this: Grid (LayoutRoot)
I have a grid view in my main page and I display some data
I have a main page from where I am making a call to load
I have a page (main.php) which loads content from an external PHP file (rpc.php).
On my main page I have this jquery code which does an ajax call
I have a index.php page that is the main page. All pages are included
I have this main page with several buttons ont it. I wonder how i

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.