If you are using sorting and paging in a SPGridView needing to persist the ViewState can be necessary on postback. I created a custom SPMenuField where cliient side scripts would change an SPListItem. The menu column needed to update based on the changes to stay accurate. If a custom sort had been performed once posted back the default sort would apply. On the onclientscriptclick method after your first javascript method include:
"javascript:__doPostBack('" + SPGridView.ClientID + "', '');";
Utilizing this method performs a postback and tells the system the SPGridView that sent the postback and keeping the ViewState intact and updating the custom menus with required changes.
fd8f6b85-a311-4f3e-a765-df456b1a4b66|0|.0