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

x
?
Solved

Gridview refresh on update.

Posted on 2007-03-28
7
Medium Priority
?
529 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 1000 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

688 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