Reputation: 4864
How do you set the size of an image in an ASP.Net TreeView?
We tried to set the size like this but the images are showing in full size:
<asp:TreeView
runat="server"
DataSourceID="KnowledgeAcademySiteMap">
<RootNodeStyle ImageUrl="/Images/book.png" Height="32px" Width="32px" />
<ParentNodeStyle ImageUrl="/Images/book.png" Height="32px" Width="32px" />
<LeafNodeStyle ImageUrl="/Images/book.png" Height="32px" Width="32px" />
</asp:TreeView>
Upvotes: 4
Views: 6122
Reputation: 17039
That height and width is applied to the tree view node, not to the image, that explains why the image size doesn't change.
You can either:
CSS:
.treeView img { width:32px; height:32px; }
ASPX:
<asp:TreeView CssClass="treeView" ...
Upvotes: 7