GridView Update mystery

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

I have a GridView tied to a SqlDataSource (table) with a PrimaryKey named
ID. When I click the UPDATE link button, the postback happens but nothing
changes. I put a comment in the Updated event of the SqlDataSource and the
comment shows.
I even checked the DataKeyNames on the GridView and that is set to the "ID"
column.
Can anyone tell me where else I might look to find out why the update is not
happening? I am doing this same thing in several other pages and they work
fine. Thanks.

David
 
I have a GridView tied to a SqlDataSource (table) with a PrimaryKey named
ID.  When I click the UPDATE link button, the postback happens but nothing
changes.  I put a comment in the Updated event of the SqlDataSource andthe
comment shows.
I even checked the DataKeyNames on the GridView and that is set to the "ID"
column.
Can anyone tell me where else I might look to find out why the update is not
happening?  I am doing this same thing in several other pages and they work
fine.  Thanks.

David

Hi David,

did you check what values you update? Perhaps, you rebuild your grid
in the Page_Load method before the update proceeded.
 
Yup...that was it. Thanks.

David
I have a GridView tied to a SqlDataSource (table) with a PrimaryKey named
ID. When I click the UPDATE link button, the postback happens but nothing
changes. I put a comment in the Updated event of the SqlDataSource and the
comment shows.
I even checked the DataKeyNames on the GridView and that is set to the
"ID"
column.
Can anyone tell me where else I might look to find out why the update is
not
happening? I am doing this same thing in several other pages and they work
fine. Thanks.

David

Hi David,

did you check what values you update? Perhaps, you rebuild your grid
in the Page_Load method before the update proceeded.
 
Back
Top