ASP.NET

Moderators: None (Apply to moderate this forum)
Number of threads: 1727
Number of posts: 3292

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Refreshing GridView after update Posted by Memphis15 on 20 Aug 2008 at 11:14 PM
Hello all,

I have an ASP.Net webpage (using VS 2008 to develop it) on the page is some textboes, dropdownlists etc. and a gridview. The gridview datasource is an accessdatasource so im using a access database.

Now when the user selects a row in the gridview the information from that row is populated into the textboxes and dropdownlists so that they can make any changes.

The problem im having is when they hit save changes and it updates the database i can't get the gridview to refresh instantly, i have to either refresh the page manually, or go to a different page on the gridview and then back to it.

I have tried using the DataBind() method of the gridview and also tried Response.Redirect to the same page but neither worked.

Any help is much appreciated, thanks in advanced.
-M3mph15
Report
Re: Refreshing GridView after update Posted by bradwang on 21 Aug 2008 at 10:47 PM
Are you using any cache?

And are you sure that the changes have actually been saved to the DB?

If so, I think re-load the page programmatically will solve your issue.


Brad Wang - .NET Freelancer from China
MSN: brad_wang_cn@hotmail.com
Skype: brad_wang
Report
Re: Refreshing GridView after update Posted by Memphis15 on 22 Aug 2008 at 12:27 AM
Hey,

Yes i am sure that the changes have been saved to the database. Because if i manually refresh the page or if i sort the gridview by a certain column it shows the changes, i just can't seem to get it to show the changes automatically.

-M3mph15
Report
Re: Refreshing GridView after update Posted by kittuemani on 18 Nov 2008 at 11:12 PM
Hey,
Gridview.Bind() is not sufficient to update the grid. You have to bind
latest dataset to u r grid also.

Gridview1.Datasource=ds;
Gridview1.DataBind();

i hope it works.

Vijay Krishna .E
www.urasp.net

Report
Re: Refreshing GridView after update Posted by pankajmk on 26 Dec 2008 at 2:02 PM
: Hello all,
:
: I have an ASP.Net webpage (using VS 2008 to develop it) on the page
: is some textboes, dropdownlists etc. and a gridview. The gridview
: datasource is an accessdatasource so im using a access database.
:
: Now when the user selects a row in the gridview the information from
: that row is populated into the textboxes and dropdownlists so that
: they can make any changes.
:
: The problem im having is when they hit save changes and it updates
: the database i can't get the gridview to refresh instantly, i have
: to either refresh the page manually, or go to a different page on
: the gridview and then back to it.
:
: I have tried using the DataBind() method of the gridview and also
: tried Response.Redirect to the same page but neither worked.
:
: Any help is much appreciated, thanks in advanced.
: -M3mph15

Hi,
You can re bind the DataGrid and see

Thanks
http://www.dotnetspark.com




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.