GridView does not refresh after insert with DetailsView

N

needin4mation

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.
 
M

Mark E. Hansen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top