Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Non-clickable Header for ListView

 
 
Old 08-12-2007   #1 (permalink)
Sorin Dolha


 
 

Non-clickable Header for ListView

I need to set the column headers of a ListView to be non-clickable (as I
don't want to implement any sorting or anything else for the ListView on user
clicking on the column headers).

I tried to use GridViewColumn.HeaderTemplate elements for my columns and
define a custom header template using TextBlock elements, as I though this
would replace the default "button"-like textblocks added by default; but this
doesn't work well for some reason, i.e. my style is shown on the header
(including any settings I set up for the custom textblocks), but the headers
are still clickable.

It seems that the clickable behavior for the header is added by a parent
container of the stylable column header (such as the
GridViewHeaderRowPresenter), so this must be resolved in another way. My next
thought then was to use a custom template for the whole ListView that will
use the GridViewHeaderRowPresenter and ItemsPresenter in a stack panel, and
then styling te GridViewHeaderRowPresenter somehow. But I didn't know how to
style the GridViewHeaderRowPresenter object either to remove the button
behavior generated for the column headers, and now I'm out of ideas.

Can someonw guide me on this? (I acknowledge I'm not very much experienced
with WPF, the resolution could be simple, but I didn't yet think of it!)
Thank you in advance for any ideas.

--
Sorin Dolha, DlhSoft

My System SpecsSystem Spec
Old 08-12-2007   #2 (permalink)
Sorin Dolha


 
 

RE: Non-clickable Header for ListView

I forgot to say, I'm using the GridView view for the ListView instance to
show up columns.

--
Sorin Dolha, DlhSoft


"Sorin Dolha" wrote:

> I need to set the column headers of a ListView to be non-clickable (as I
> don't want to implement any sorting or anything else for the ListView on user
> clicking on the column headers).
>
> I tried to use GridViewColumn.HeaderTemplate elements for my columns and
> define a custom header template using TextBlock elements, as I though this
> would replace the default "button"-like textblocks added by default; but this
> doesn't work well for some reason, i.e. my style is shown on the header
> (including any settings I set up for the custom textblocks), but the headers
> are still clickable.
>
> It seems that the clickable behavior for the header is added by a parent
> container of the stylable column header (such as the
> GridViewHeaderRowPresenter), so this must be resolved in another way. My next
> thought then was to use a custom template for the whole ListView that will
> use the GridViewHeaderRowPresenter and ItemsPresenter in a stack panel, and
> then styling te GridViewHeaderRowPresenter somehow. But I didn't know how to
> style the GridViewHeaderRowPresenter object either to remove the button
> behavior generated for the column headers, and now I'm out of ideas.
>
> Can someonw guide me on this? (I acknowledge I'm not very much experienced
> with WPF, the resolution could be simple, but I didn't yet think of it!)
> Thank you in advance for any ideas.
>
> --
> Sorin Dolha, DlhSoft

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
no more clickable hyperlinks in email Vista mail
Hyperlinks not underlined and not clickable Live Mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46