GridView does not refresh after insert with DetailsView

Discussion in 'ASP .Net' started by needin4mation@gmail.com, Oct 9, 2006.

  1. Guest

    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.
     
    , Oct 9, 2006
    #1
    1. Advertising

  2. On 10/09/06 15:09, 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.
     
    Mark E. Hansen, Oct 11, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cannontrodder
    Replies:
    1
    Views:
    752
    cannontrodder
    Jul 25, 2006
  2. Mark Olbert
    Replies:
    4
    Views:
    7,481
    Steven Cheng[MSFT]
    Mar 7, 2007
  3. mpaine
    Replies:
    5
    Views:
    540
    Steven Cheng [MSFT]
    Jun 13, 2008
  4. eagle

    Insert & Insert/Repeat buttons in a detailsview

    eagle, Jul 12, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    1,080
    eagle
    Jul 12, 2007
  5. Feege
    Replies:
    0
    Views:
    493
    Feege
    Dec 20, 2005
Loading...

Share This Page