From: Latif Yalcinoglu on
Hi Hoi,

As far as I know, you can not assign a callback function to the column header of an uitable. But i can suggest 3 ways to you:

1- You can put pushbuttons on the headers at uitable,

2- You can put textboxes on the headers at uitable and assign ButtonDownFcn to the texboxes,

3- At uitable, you can use KeyPressFunction together with CellSelectionCallback to assign a keyboard key (lets say "s" in your case). You get the selected cell, therefore column number, using CellSelectionCallback and write your sorting algorithm at KeyPressFunction.

Regards,

Latif



"Hoi Wong" <wonghoi(a)stanford.edu> wrote in message <g970el$g7g$1(a)news.stanford.edu>...
> For my project, I want to sort the whole table according to the entries of
> the column when I click on the heading (like most GUI). Is there easy way to
> achieve that in MATLAB GUI? I can't find any callback property that's
> associated with clicking on the column heading.
>
> Any help will be appreciated! Thanks in advance.
>
> Cheers,
> Hoi
>
>