Datagrid not updated during delete, but updated during insert and update

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Datagrid not updated during delete, but updated during insert and update

    Hello everyone.

    A test webform here, single datagrid bound to one table through dataset, and controls to delete, update and insert data. The code is built upon the samples from Quickstarts. The problem is: when you perform a delete operation, the data (single row) is deleted just fine, however, the datagrid on the webform is not updated. Well actually, it is updated, but a one-step delay occurs. I.e. when you select the record "a" and hit delete, it is deleted but still shown in the datagrid, when you then select record "b" and hit delete, the data grid no longer shows record "a" but still shows record "b", etc.

    Insert an Update actions work fine - ie changes are immediately reflected in the datagrin on a webform. I am using the same dataset update methods for both insert, update and delete webform events, so it's weird why only delete goes fishy. The methods called after each update are:

    mysqldataadapter.Fill(mydataset, "mytable");
    mydatagrid.DataBind()


    Any ideas here?

    --
    Dmitry Korolyov,
    [email]d__k@nosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Dmitry Korolyov Guest

  2. Similar Questions and Discussions

    1. Updated template in DW, how do I update the pages on thesite?
      Hi This is probably a dumb question: I have updated the template of the site I am working by adding another tab to the global navigation in DW....
    2. Play effect when row updated in DataGrid
      I have a DataGrid that contains N number of rows. When one of the rows is updated I'd like to play some sort of effect to highlight the fact that...
    3. Get updated values from DataGrid
      Hi I have a DataGrid, with Edit links in each row. The Edit button works, the user can change the values. But I can't get updating to work. ...
    4. DataGrid: OnUpdateCommand - getting the updated values
      Greeting all, I have been reading a number of posts and all the samples I have seen are the same, yet I can't access the updated values of a...
    5. Imported + updated symbols don't stay updated
      Hi everybody. I apologize for posting a question that probably any newbie should know, but ... I'm a rank Fireworks newbie. My problem is that the...
  3. #2

    Default Re: Datagrid not updated during delete, but updated during insert and update

    Bind the datagrid after deleting the record from the database. This should solve your problem.

    --
    Saravana
    Microsoft India Community Star,MC**
    [url]www.extremeexperts.com[/url]



    "Dmitry Korolyov" <d__k@nospamformorons.mail.ru> wrote in message news:uG8JtpPgDHA.2172@TK2MSFTNGP09.phx.gbl...
    Hello everyone.

    A test webform here, single datagrid bound to one table through dataset, and controls to delete, update and insert data. The code is built upon the samples from Quickstarts. The problem is: when you perform a delete operation, the data (single row) is deleted just fine, however, the datagrid on the webform is not updated. Well actually, it is updated, but a one-step delay occurs. I.e. when you select the record "a" and hit delete, it is deleted but still shown in the datagrid, when you then select record "b" and hit delete, the data grid no longer shows record "a" but still shows record "b", etc.

    Insert an Update actions work fine - ie changes are immediately reflected in the datagrin on a webform. I am using the same dataset update methods for both insert, update and delete webform events, so it's weird why only delete goes fishy. The methods called after each update are:

    mysqldataadapter.Fill(mydataset, "mytable");
    mydatagrid.DataBind()


    Any ideas here?

    --
    Dmitry Korolyov,
    [email]d__k@nosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Saravana Guest

  4. #3

    Default Re: Datagrid not updated during delete, but updated during insert and update

    I am binding it after closing connection, which also means after deleting the record.

    By the way, I've just created a blank web form (now not using designer), and migrated all my code there, creating connection, dataset etc objects manually withing the code. It works. Old one (created by visual designer) still shows that ugly delete lag.

    --
    Dmitry Korolyov,
    [email]d__k@nosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    "Saravana" <saravank@sct.co.in.nospam> wrote in message news:ua8aLkQgDHA.3324@TK2MSFTNGP11.phx.gbl...
    Bind the datagrid after deleting the record from the database. This should solve your problem.

    --
    Saravana
    Microsoft India Community Star,MC**
    [url]www.extremeexperts.com[/url]



    "Dmitry Korolyov" <d__k@nospamformorons.mail.ru> wrote in message news:uG8JtpPgDHA.2172@TK2MSFTNGP09.phx.gbl...
    Hello everyone.

    A test webform here, single datagrid bound to one table through dataset, and controls to delete, update and insert data. The code is built upon the samples from Quickstarts. The problem is: when you perform a delete operation, the data (single row) is deleted just fine, however, the datagrid on the webform is not updated. Well actually, it is updated, but a one-step delay occurs. I.e. when you select the record "a" and hit delete, it is deleted but still shown in the datagrid, when you then select record "b" and hit delete, the data grid no longer shows record "a" but still shows record "b", etc.

    Insert an Update actions work fine - ie changes are immediately reflected in the datagrin on a webform. I am using the same dataset update methods for both insert, update and delete webform events, so it's weird why only delete goes fishy. The methods called after each update are:

    mysqldataadapter.Fill(mydataset, "mytable");
    mydatagrid.DataBind()


    Any ideas here?

    --
    Dmitry Korolyov,
    [email]d__k@nosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Dmitry Korolyov Guest

  5. #4

    Default Re: Datagrid not updated during delete, but updated during insert and update

    Can you send your code. We can look into that...

    --
    Saravana
    Microsoft India Community Star,MC**
    [url]www.extremeexperts.com[/url]



    "Dmitry Korolyov" <d__k@nospamformorons.mail.ru> wrote in message news:OHqqnwRgDHA.632@TK2MSFTNGP10.phx.gbl...
    I am binding it after closing connection, which also means after deleting the record.

    By the way, I've just created a blank web form (now not using designer), and migrated all my code there, creating connection, dataset etc objects manually withing the code. It works. Old one (created by visual designer) still shows that ugly delete lag.

    --
    Dmitry Korolyov,
    [email]d__k@nosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    "Saravana" <saravank@sct.co.in.nospam> wrote in message news:ua8aLkQgDHA.3324@TK2MSFTNGP11.phx.gbl...
    Bind the datagrid after deleting the record from the database. This should solve your problem.

    --
    Saravana
    Microsoft India Community Star,MC**
    [url]www.extremeexperts.com[/url]



    "Dmitry Korolyov" <d__k@nospamformorons.mail.ru> wrote in message news:uG8JtpPgDHA.2172@TK2MSFTNGP09.phx.gbl...
    Hello everyone.

    A test webform here, single datagrid bound to one table through dataset, and controls to delete, update and insert data. The code is built upon the samples from Quickstarts. The problem is: when you perform a delete operation, the data (single row) is deleted just fine, however, the datagrid on the webform is not updated. Well actually, it is updated, but a one-step delay occurs. I.e. when you select the record "a" and hit delete, it is deleted but still shown in the datagrid, when you then select record "b" and hit delete, the data grid no longer shows record "a" but still shows record "b", etc.

    Insert an Update actions work fine - ie changes are immediately reflected in the datagrin on a webform. I am using the same dataset update methods for both insert, update and delete webform events, so it's weird why only delete goes fishy. The methods called after each update are:

    mysqldataadapter.Fill(mydataset, "mytable");
    mydatagrid.DataBind()


    Any ideas here?

    --
    Dmitry Korolyov,
    [email]d__k@nosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Saravana Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139