I have a grid view and i have bonded sql data source to that. on page i have drop down, as soon as selected value of drop down get changes, i change the select query of sql data source and again binding the data to grid view. before doing this if i update the grid view row its get updated but after doing previous process my update is not working. it don't show me any error. it don't take edited values.

1 Answer
1

I suspect that this is happening because SelectCommand property of Sql Data source is not backed up by view-state (for security purposes). So when you change the select command in one of the event, the change is reflected only for that request. On subsequent post-back (for update event), the design time select command will be used and it may change the data bound to grid-view causing update to fail.

As a solution, you can try using FilterExpression and FilterParameters if it make sense in your scenario (check the example in FilterExpression help).