Windows Vista Forums

Non-clickable Header for ListView

  1. #1


    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

  2. #2


    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

Non-clickable Header for ListView

Similar Threads
Thread Forum
Login Screen but nothing clickable
Hi one and all, Have a problem I've come across before. After someone dlownloaded some banking security software (Trusteer Rapport), the Vista...
Crashes and Debugging
no more clickable hyperlinks in email
can anyone help? About 5 days ago my windows mail (in Vista) stopped having clickable hyperlinks. I thought if you went to the "advanced"...
Vista mail
Hyperlinks not underlined and not clickable
I've just started trial use of Windows Live Mail before converting my mail system from OE. The first thing I noticed was that a hyperlink I...
Live Mail
Non clickable rectangle?
Hi, I am trying to figure out how to make a shape that doesn't respond to mouse events. I want to draw the rectangle with a transparent fill and...
Avalon
Clickable folders in Save As Address Bar?
I like the clickable folders in the Address Bar, but they don't seem to appear in the Save As dialogue. Is this a feature?
Vista file management
Getting ListView items to exand to width of ListView
Is it possible to get the items placed inside of a ListView Control to automatically expand to the full width of the Control? If I place them inside...
Avalon
change Background color header listview
I have not been able to change the Background's header of the listView. somebody can help me ? thanks
Avalon