0

after i sort my gridview, when i want to edit a row the selected row is completely wrong.

what can i do?

1 Answer 1

1

After sorting, try setting the SelectedIndex property to -1.

Alternatively, try using the SelectedDataKey property (check this link for details). Note that you may have to write your code in the PreRender event for the data keys to be set.

Sign up to request clarification or add additional context in comments.

1 Comment

In a few forums, it's mentioned about datarowbound to fix this problem, but i can't figured out why

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.