Rank: Newbie Groups: Member
Joined: 8/8/2008 Posts: 2
|
Each time you sort a grid at client side it launches ClientSideOnItemSelected event even though the selected item is the same as before. You can reproduce the problem by adding the following function to a page and setting ClientSideOnItemSelected="select" to some grid that has FullRowMode set to true.
<script type="text/javascript"> function select() { alert('New selection.'); } </script>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
This behavior is by design. The reason is even it is still the same item, the item's index may have been changed, thus ClientSideOnItemSelected gives user a chance to handle that.
If you do not want certain code to be called twice, you can save the last selected item in a variable, then compare that with the new selected item. If it is the same, you can ignore it.
Hope this helps.
Thanks
|