Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WCF and WF
  4. Tree View design

Tree View design

Scheduled Pinned Locked Moved WCF and WF
wpfwcfdesigndata-structures
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thangavel1987
    wrote on last edited by
    #1

    When i am change the treeview item style as an text block like this when select this item the color changes to blue how i do that

    <treeviewitem.itemtemplate>
    <datatemplate>
    <textblock text="{Binding Code}" background="{Binding Color}" />
    </datatemplate>
    </treeviewitem.itemtemplate>

    A 1 Reply Last reply
    0
    • T thangavel1987

      When i am change the treeview item style as an text block like this when select this item the color changes to blue how i do that

      <treeviewitem.itemtemplate>
      <datatemplate>
      <textblock text="{Binding Code}" background="{Binding Color}" />
      </datatemplate>
      </treeviewitem.itemtemplate>

      A Offline
      A Offline
      ABitSmart
      wrote on last edited by
      #2

      What is your question ? The Selection hightlight color is Blue. When you select a node its Background should turn Blue to indicate the node is selected.

      T 1 Reply Last reply
      0
      • A ABitSmart

        What is your question ? The Selection hightlight color is Blue. When you select a node its Background should turn Blue to indicate the node is selected.

        T Offline
        T Offline
        thangavel1987
        wrote on last edited by
        #3

        ya correct but i set the color from the database using binding . so after they select i try to change the color.

        A 1 Reply Last reply
        0
        • T thangavel1987

          ya correct but i set the color from the database using binding . so after they select i try to change the color.

          A Offline
          A Offline
          ABitSmart
          wrote on last edited by
          #4

          thangavel1987 wrote:

          i set the color from the database using binding

          You have set the background color of each item. This is no way related to changing the color of background on selection.

          thangavel1987 wrote:

          so after they select i try to change the color

          How ? in the code you posted there's no trace of you doing this. Have you tried a trigger on the IsSelected property which changes the background color when IsSelected is true ? You could make a style for the TreeViewItem containing the trigger and then set the style to the ItemsContainerStyle property of the TreeView.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups