Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Change FirstChildNode left position as same to its parent (TreeView)

Change FirstChildNode left position as same to its parent (TreeView)

Change FirstChildNode left position as same to its parent (TreeView)

I've been struggle to solve this problem in within one day but still unable to get rid on it. I've attached along picture to clarify on this problem to what I need. I've define a border to entire text area of nodes and those server control nodestyle seems to be only apply everythings inside the nodes area but not outside where you've to define your own ways.

Markup View:

CODE --> asp.net

<div style="float: left;padding-left:25px">
       <asp:TreeView ID="ProductLineView" runat="server" EnableClientScript="true" PopulateNodesFromClient="true" ClientIDMode="Static" Width="850px"  ExpandImageUrl="~/App_Themes/PPHPG/Images/plus.png" 
         CollapseImageUrl="~/App_Themes/PPHPG/Images/minus.png" OnTreeNodePopulate="ProductLineView_TreeNodePopulate">
         <NodeStyle CssClass="ProductLineNodeStyle" Width="850px"  NodeSpacing="3.5" />
         <LeafNodeStyle CssClass="ProductLineLeaftNodeStyle" NodeSpacing="1.2"  />

    <script type="text/javascript">
        function pageLoad(){
            $("[id*='ProductLineViewn']").each(function () {
                            var targetid = $(this).attr("Id");
                            if (targetid.indexOf("Nodes") != -1) {
                                        "margin-left": "85px",
                                        "width": "765px",
                                        "margin-bottom": "25px",
    <style type="text/css">
            #ProductLineView {
                  font-size: 1.8em;
            .ProductLineNodeStyle {
                  border: 1px solid black;
            .ProductLineLeaftNodeStyle {
                  margin-left: 5px;

Code Behind:

    var PreviousJobNumber = String.Empty;
    var NodeCount = 0;
    dynamic ActiveNode = null;
    dynamic StepCount = null;
    var JobDescription = String.Empty;
    foreach(var item in query)
             dynamic SectionId = null;
             TreeNode DetailNode;
             if (PreviousJobNumber != item.ps_no)
                     PreviousJobNumber = item.ps_no;
                     SectionId = item.Id.ToString();
                     Int32 SectionValue = Convert.ToInt32(SectionId);
                     JobDescription = timesheet.SectionGroups.Where(p => p.Id ==   SectionValue).Select(p => p.StockDescription).SingleOrDefault();
                     TreeNode HeaderNode = new TreeNode();                  
                                                HeaderNode.Text = item.ps_no + "        " + "Receive Quantity" + "        " + "Target Quantity" + "        " + "<a href=''>Access</a>";
                     TreeNode DescriptionNode = new TreeNode();
                     DescriptionNode.Text = JobDescription;
                     DescriptionNode.Value = "Desc";                                                                HeaderNode.ChildNodes.Add(DescriptionNode);
                     StepCount = 1;
                     DetailNode = new TreeNode();
                     DetailNode.Text = "(Step " + StepCount + ") " + SectionId;
                     DetailNode.Value = SectionId;                                           
                     ActiveNode = NodeCount;
                     NodeCount += 1;
                          StepCount += 1;
                          SectionId = item.Id.ToString();
                          DetailNode = new TreeNode();
                          DetailNode.Text = "(Step " + StepCount + ") " + SectionId;
                          DetailNode.Value = SectionId;
Thanks appropriate to someone could help..

RE: Change FirstChildNode left position as same to its parent (TreeView)

this question should be posted here: forum215: HTML, XHTML & CSS as it is a CSS question,not an ASP.NET question

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close