This is a migrated thread and some comments may be shown as answers.

Css class problem

1 Answer 63 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lubna Ansari
Top achievements
Rank 1
Lubna Ansari asked on 01 Jun 2010, 10:12 AM
Hi,
I am using a treeview with some nodes having child nodes and some do not. When I apply any class to parent nodes only nodes having child got changed and nodes without child did not. Also how can I set spacing between parent nodes like cellspacing and cellpadding attributing of table.

Regards,
Lubna.

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 04 Jun 2010, 10:04 AM
Hi Lubna Ansari,

About the CssClass applied to nodes with or without children:
- This problem does not reproduce. Probably something else overrides the style provided for some of the nodes. In order to be on top of all styles with same selectors use "!important".

About spacing between nodes:
- You can achieve this by setting padding-bottom to the the elements that have the class "rtLI".

Here is an complete example that you can try out:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
<style type="text/css">
.SampleClassName
{
    text-decoration:underline !important;
}
.rtLI
{
    padding-bottom:12px !important;
}
</style>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server">
        </asp:ScriptManager>
        <telerik:RadTreeView runat="server" ID="tree">
            <Nodes>
                <telerik:RadTreeNode CssClass="SampleClassName" Text="Node1">
                    <Nodes>
                        <telerik:RadTreeNode Text="Child1" />
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode CssClass="SampleClassName" Text="Node2">
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeView>
    </div>
    </form>
</body>
</html>

Hope this is going to help you!


Regards,
Nikolay Tsenkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Lubna Ansari
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or