Professional Web Applications Themes

Datagrid not updated during delete, but updated during insert and update - ASP.NET Data Grid Control

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

  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__knosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Dmitry Korolyov Guest

  2. #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__knospamformorons.mail.ru> wrote in message news:uG8JtpPgDHA.2172TK2MSFTNGP09.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__knosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Saravana Guest

  3. #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__knosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    "Saravana" <saravanksct.co.in.nospam> wrote in message news:ua8aLkQgDHA.3324TK2MSFTNGP11.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__knospamformorons.mail.ru> wrote in message news:uG8JtpPgDHA.2172TK2MSFTNGP09.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__knosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Dmitry Korolyov Guest

  4. #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__knospamformorons.mail.ru> wrote in message news:OHqqnwRgDHA.632TK2MSFTNGP10.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__knosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    "Saravana" <saravanksct.co.in.nospam> wrote in message news:ua8aLkQgDHA.3324TK2MSFTNGP11.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__knospamformorons.mail.ru> wrote in message news:uG8JtpPgDHA.2172TK2MSFTNGP09.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__knosmapformorons.mail.ru[/email]
    To e-mail me, remove "nospamformorons".


    Saravana Guest

Similar Threads

  1. Updated template in DW, how do I update the pages on thesite?
    By chelseasian in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: September 8th, 09:49 AM
  2. Play effect when row updated in DataGrid
    By anoweb in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: May 21st, 11:34 AM
  3. Get updated values from DataGrid
    By Chris Mahoney in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: September 20th, 03:43 PM
  4. DataGrid: OnUpdateCommand - getting the updated values
    By Dan in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: August 18th, 10:16 AM
  5. Imported + updated symbols don't stay updated
    By Bbonnn webforumsuser@macromedia.com in forum Macromedia Fireworks
    Replies: 1
    Last Post: August 8th, 01:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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