473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Refreshing / requerying GridView control when page is submitted?

Hi All,

I have an ASP.NET page that is used to insert records into an SQL
Server table (see previous post). I also have a GridView on the same
page that displays the results of a query on the same table the records
are inserted into when the page is submitted.

I'm wondering if there's a way to requery / refresh the records being
displayed by the GridView when the page is submitted?

Currently when I submit the page, which inserts a record, the GridView
doesn't refresh / requery to display the newly inserted record.

Can anyone point me at what I should be doing in the page submit code
to make sure the GridView also displays the record just inserted?

Many thanks in advance!

Much warmth,

planetthoughtful
---
"Lost in thought"
http://www.planetthoughtful.org

May 26 '06 #1
1 4679
If you are inserting through your datasource, it should only be a matter of
rebinding to your datasource .. if not just redread your datasource and then
rebind it.

Cheers,

Greg Young
MVP - C#
"planetthoughtful" <pl**************@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Hi All,

I have an ASP.NET page that is used to insert records into an SQL
Server table (see previous post). I also have a GridView on the same
page that displays the results of a query on the same table the records
are inserted into when the page is submitted.

I'm wondering if there's a way to requery / refresh the records being
displayed by the GridView when the page is submitted?

Currently when I submit the page, which inserts a record, the GridView
doesn't refresh / requery to display the newly inserted record.

Can anyone point me at what I should be doing in the page submit code
to make sure the GridView also displays the record just inserted?

Many thanks in advance!

Much warmth,

planetthoughtful
---
"Lost in thought"
http://www.planetthoughtful.org

May 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
0
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
0
by: H5N1 | last post by:
Hi there My problem is that in when I update GridView row, which is nested into DataList control, I want to refresh also DataList in which the GridView is nested, since after update, trigger in...
1
by: Mike Grace | last post by:
Hi, I have a gridview which is using a SqlDataSource to update a table. The SqlDatasource is using a stored procedure to update the table. If I edit a row, change a value and click update...
0
by: steve.craver | last post by:
I am working with a multi-field search form which, when the form is submitted, queries a database and returns the results into a paginated GridView object. The site is being developed with master...
1
by: joechipubik | last post by:
I have a GridView in a FormView that has as its datasource a DataTable that is stored in the session cache. When I first load the page the GridView is displayed correctly, but on subsequent loads...
9
by: Mark Denardo | last post by:
This is related to another post I submitted, but I'll be more precise this time. I have a web page that contains an Image webcontrol that loads its image by: Image1.ImageUrl="<username>.jpg",...
3
by: Asaf | last post by:
Hi, I have SqlDataSource control that makes a "select count" to show how many rows there are in a Table and it is working fine on first page load. The problem is that when I am inserting a new...
8
by: gerry | last post by:
The PagerSettings.Visible property is not being handled properly by the GridView control. The value assigned to this property is not applied until after a postback. Simplest test : .aspx...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.