Solved

Gridview refresh on update.

Posted on 2007-03-28
7
527 Views
Last Modified: 2008-01-09
I am using visual studio 2005 standard. I created a gridview that uses an sqldatasource who's select query uses a text box (a contract number) on the page as a parameter. I have a button that runs the update query in the sqldatasource, and I have a button that runs an update based on a text box on the page.
The page display is based on the contract number text box. In order to get the contract number to perpetuate after the update I use " Response.Redirect("Default.aspx?thecontract=" & TheContractID.Text & "", False) ".
The problem is the gridview does not refesh. In fact it does not even show up. The contract number text box's autopostback is set to true.
I need to get the gridview to refresh when the page loads, or the update is run.
0
Comment
Question by:estanton
[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
  • 6
7 Comments
 
LVL 5

Accepted Solution

by:
asp_lha earned 500 total points
ID: 18808576
try to do  GridView1.DataBind() after update
0
 

Author Comment

by:estanton
ID: 18808708
That did not work. I tried it in the sqldatasource's updating event, and also in the " GridView1_SelectedIndexChanged " sub that calls an update function.
0
 

Author Comment

by:estanton
ID: 18812286
I will be away from my computer until 4/2/07, but
I still need help.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:estanton
ID: 18837701
If anyone is watching this post.. I am back and could really use the help.
0
 

Author Comment

by:estanton
ID: 18839325
I really need help.
0
 

Author Comment

by:estanton
ID: 18839854
Maybe I shoul d change my quesiton a bit. I have a gridveiw that uses a text box's value as a paramteter in the select query. When I load the page, passing the text box's value in the url  ( Default.aspx?textboxvar=5555555 ) the gridview does not load. I collect the variable and populate the text box, but the gridveiw does not show up. I tried putting using gridview1.databind in the Page_Load event, but it doe not work.
If I change the text in the text box the, the gridview will load. I presume this is because I have the autopost back property set to true.
0
 

Author Comment

by:estanton
ID: 18860644
I figured it out. I have to call the datbind method during page prerender by overriding the prerender event.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

630 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