SPTreeView: Selected node CSS bug


I may have found a bug in the SPTreeView control. When you select a node the CSS class declared in the SelectedNodeStyle isn't applied to the node. Other than that it seems to behave correctly.

Sample markup (in a LAYOUTS page)

<wssuc:InputFormControl runat="server" LabelText="Folder:">
  <Template_Control>
    <SharePoint:SPTreeView id="tvFolder" runat="server" OnLoad="GetFolders" ShowExpandCollapse="False" OnSelectedNodeChanged="RefreshPositions">
      <NodeStyle CssClass="ms-vb-user" />
      <SelectedNodeStyle CssClass="ms-tvselected" />
      <HoverNodeStyle CssClass="ms-tvselected" />
    </SharePoint:SPTreeView>
  </Template_Control>
</
wssuc:InputFormControl>

Because of this it might be better to use the ASP.NET TreeView control. In the above sample the only thing that needs to change is <SharePoint:SPTreeView /> to <asp:TreeView />

 

 


Comments

Tuesday, 10 May 2011 05:26 by Sri
Thank a ton for your suggestion, it solved my problem.

CAPTCHA Image Validation