Well surely you will use two event handlers. But if I remember I did face this problem in past, datagrid was firing the itemcommand on sort so I put a check on top in itemcommand event handler if e.commandname <> 'sort' and it worked fine. put a break point on sort and itemcommand event handlers and you will see that sort command is also going to itemcommand event handler.
-----