Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView does not refresh after insert with DetailsView

Reply
Thread Tools

GridView does not refresh after insert with DetailsView

 
 
needin4mation@gmail.com
Guest
Posts: n/a
 
      10-09-2006
Not sure what I'm doing wrong here. I have a gridview and a
detailsview. The detailsview is set to insert by default. When I
insert data the detailsview it works. The data goes in the database.
The gridview on the page, however, never refreshes to show the new row.
The sql for the gridview defaults to a LIKE % and when the page first
loads I can see all the records.

If after I try an edit a gridview record and delete or cancel, then my
new record will show up (it queries correctly.)

What have I done wrong?

Thank you for any help.

 
Reply With Quote
 
 
 
 
Mark E. Hansen
Guest
Posts: n/a
 
      10-11-2006
On 10/09/06 15:09, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Not sure what I'm doing wrong here. I have a gridview and a
> detailsview. The detailsview is set to insert by default. When I
> insert data the detailsview it works. The data goes in the database.
> The gridview on the page, however, never refreshes to show the new row.
> The sql for the gridview defaults to a LIKE % and when the page first
> loads I can see all the records.
>
> If after I try an edit a gridview record and delete or cancel, then my
> new record will show up (it queries correctly.)
>
> What have I done wrong?
>
> Thank you for any help.
>


Does your DetailsView have an Item Inserted Event? If so, place a call to
the Grid View's DataBind() method in there. You may want to do the same
with the Item Updated and Item Deleted events.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does DetailsView become read-only after insert? mpaine ASP .Net 5 06-13-2008 09:22 AM
Insert & Insert/Repeat buttons in a detailsview eagle ASP .Net Datagrid Control 0 07-12-2007 12:47 PM
Insert in detailsview based on a gridview selectedvalue et ASP .Net Datagrid Control 0 01-27-2007 01:40 AM
Detailsview loses insert mode contents when Insert fails... cannontrodder ASP .Net 1 07-25-2006 08:38 AM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM



Advertisments