I have a DataGrid. Click its item, it calls an itemClick
event to do run some function. When I click its head to sort before
I selected any item it works fine. But if I selected item first,
when I sort, it do sort first then go to run itemClick event
I would like to know how to only do sort whatever it selected
item or not?
When you click the column header that, too, is an itemClick.
So you'll have to check the rowIndex property of the event
parameter in your itemClick event handler. I think the rowIndex for
the header row is 0, but it might be -1; you'll have to