GridView Update mystery

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
 
A

Alexey Smirnov

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

David C

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.
 

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

Top