Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Non-clickable Header for ListView

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 08-12-2007   #1 (permalink)
Sorin Dolha
Guest


 

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
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
crazy cursor - cursor keeps bouncing back form certain clickable a jordanly Vista performance & maintenance 0 05-10-2008 04:46 AM
Non clickable rectangle? clintsinger Avalon 1 02-06-2007 02:11 PM
Clickable folders in Save As Address Bar? Nigel Molesworth Vista file management 1 01-06-2007 08:28 PM
Getting ListView items to exand to width of ListView John Dunn Avalon 0 11-29-2006 12:45 PM
change Background color header listview raulramirez Avalon 0 05-10-2006 04:01 AM


Update your Vista Drivers Update Your Vista Drivers Now!!

Vistax64.com 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 2005-2008
Page generated in 0.25318 seconds with 10 queries