MATLAB: How to automatic detect selections in different uitables, and clear the selections in some of the uitables? Thanks

clear selectionmultipleuitable

Hi,
I meet some problems and wonder if you could help me out.
Suppose we have two uitable objects, say A and B, both visible all the time. Users could make selections in both A and B. The goals I try to reach are
1, how can I/code check/detect whether uses make selections in both A and B;
2, assuming users make selections in both A and B, users can clear their selections in uitable A using ctrl+click, but how can the code clear the selections in A automatically?
I have googled online for quite a while, but I have no luck out of it. could anyone nicely help me out? Thank you.
Jon

Best Answer

If you want to clear all the selections, you can redraw the table (h is the uitable handle):
tmp = get(h,'data');
set(h,'Data',[]);
set(h,'data',tmp);
clear tmp