Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using ASP.NET 2.0 how to refresh a GridView when a second page triggers some event

Posted on 2009-04-10
4
Medium Priority
?
211 Views
Last Modified: 2012-06-22
Hi, I need to develop a small program that allows the user to create a backorder of items. I would like to use GridView for showing the items as they can be as many as they like.

Every item can have one product code and the user should lookup into a stored procedure to let him chose the item after a filtering process as we have thousands of record of items and I need to show the results paged.

Now, my question since I am really newbie to asp.net is, which should be the fastest way to this approach. I think opening a second page where the user could select the item would do, but then how should I refresh my Gridview when the second page is closed?

Any advice would do. Thank you.
0
Comment
Question by:osmendez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
Haris V earned 2000 total points
ID: 24119007
0
 

Author Comment

by:osmendez
ID: 24119248
Thank you Sirah, I just figured it out with your first link.
0
 

Expert Comment

by:samgiuoco
ID: 24119286
You could store a datatable for these backorder items in a Session variable.

Datatable tblBackorder = new Datatable();
... set up the table...
   Session["backorder"] = tblBackorder;


Then you could navigate to other pages to browse items and add rows to the table.

Datatable tblBackorder = (Datatable)Session["backorder"];
... add items ...
 Session["backorder"] = tblBackorder;

Then go back to your Grid page, get the table from Session and databind it.
The items you were browsing on other pages will appear even if the page was in a new window.
If it is in a seperate window, however, you need to address the added complication of refreshing the Grid page.
0
 

Author Comment

by:osmendez
ID: 24120533
Thanks for your prompt answer Samqiuoco, at the end I dediced to leave both Grids on the same page. It was a pain in the ass for me to fire the DataBind() method from a child window.

I'm sure this is possible but I don't have any clue on how to do it. Anyway, you session variable holding the datatable is great!
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question