2011-11-09 2 views
0

안녕하세요, 모두 탐색하지 않을 때 잘 작동하는 treeview에 대해 selectednodestyle을 적용했습니다. 하지만 네비게이션에서 트리 뷰 선택된 노드에 적용된 색상을 볼 수 없습니다. 다음은 마스터 페이지에서 내 디자인이masterpage에서 Treeview를 탐색하는 동안 Treeview의 SelectedNodeStyle을 유지하십시오.

<asp:TreeView ID="TreeViewCategories" runat="server" ExpandDepth="0" Style="min-height: 200px; 
     max-height: 500px;" NodeIndent="0" LeafNodeStyle-CssClass="LeafNodesStyle" CssClass="TreeView" 
     NodeStyle-CssClass="NodeStyle" ParentNodeStyle-CssClass="ParentNodeStyle" RootNodeStyle-CssClass="RootNodeStyle" 
     SelectedNodeStyle-CssClass="SelectedNodeStyle" LeafNodeStyle-Width="100%" NodeStyle-Width="100%" 
     ParentNodeStyle-Width="100%" RootNodeStyle-Width="100%" Font-Size="12pt"> 
     <Nodes> 
      <asp:TreeNode Text="All Items" NavigateUrl="~/Default3.aspx" SelectAction="SelectExpand" 
       Value="All Items"> 
       <asp:TreeNode Text="Hello" Value="Hello"></asp:TreeNode> 
      </asp:TreeNode> 
     </Nodes> 
    </asp:TreeView> 

이 내 css

<style type="text/css"> 
    .TreeView 
    { 
     border-bottom: 1px dotted #B2B2B2 !important; 
    } 
    .TreeView div 
    { 
     margin-left: 5px; 
    } 
    .TreeView table 
    { 
     border-top: 1px dotted #B2B2B2 !important; 
    } 
    .TreeView div table 
    { 
     border-bottom: none !important; 
     border-top: none !important; 
    } 
    .TreeView table td 
    { 
     padding: 2px 0; 
    } 
    .LeafNodesStyle 
    { 
    } 
    .RootNodeStyle 
    { 
    } 
    /* ALL ELEMENTS */.NodeStyle 
    { 
    } 
    .ParentNodeStyle 
    { 
     /*background:yellow;*/ 
    } 
    .SelectedNodeStyle 
    { 
     font-weight: bold; 
     color: #6799D1; 
     display: block; 
     padding: 2px 0 2px 3px; 
    } 
</style> 

입니다하지만 난 어떤 사람이 나에게

+0

어떤 도움을 내가 위해 지금 변경해야 – Dotnet

답변

1

을 도울 수있는 페이지로 이동 한 후 선택한 노드의 색상을 적용 할 수 없습니까 귀하의 코드가 잘 작동합니다. 그래, CSS가 있습니다. 선택한 텍스트의 텍스트가 으로 굵게 표시되면이됩니다.

귀하의 토대가 텍스트의 색상을 변경하는 경우, 약간의 문제가 있습니다. 당신은 소스 코드를 볼 것이다 경우뿐만 아니라 SelectedNodeStyle CSS 스타일은 항목에 적용하지만,이 또한

NodeStyle FooterContent_TreeViewCategories_2 LeafNodesStyle FooterContent_TreeViewCategories_8 SelectedNodeStyle FooterContent_TreeViewCategories_10 

은 그래서 취할 색상의 변화에 ​​대한 귀하의 CSS를 색상에 중요한 몇 가지를! 퍼팅 제안 효과.

.SelectedNodeStyle 
{ 
    font-weight: bold; 
    color: #6799D1 !important; 
    display: block; 
    padding: 2px 0 2px 3px; 
} 
+0

은 추가 – Dotnet

+0

내 요구 사항에 따라 해결하는하시기 바랍니다! 당신의 SelectedNodeStyle CSS의 클래스에 중요. 위 참조. –

관련 문제