GridView refresh problem

C

coynej60

I have a GridView that is bound to a SqlDataSource that uses Stored
Procedures for its Select, Insert, Update and Delete Commands. The
Gridview only contains one visible column (PK Identity column is
hidden). There is a textbox and button that I use to submit a new row.
Everything works fine, however when I submit a new row it does not
show up in the Gridview after I rebind the data. In the Page_Load
event (outside of my check for a postback so it should always happen) I
call the DataBind method of both the Gridview and the DataSource. If I
then add a second new row the first one will be visible but not the
second, if I put any row into edit mode then any I have submitted will
show up. I have been working on this for a couple of days if anyone
has any ideas I would greatly appreciate it.

P.S. Don't know if this would have any effect but this is happening on
a Content Page.

thanks,

Jake Coyne
 
C

coynej60

I was able to solve my problem by moving the DataBind call from the
Page_Load event to the PreRenderComplete event. Just for my own
edification does anyone know why this fixed the issue?
 

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,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top