Treeview XML - Mark checkboxes checked onload

2 posts, 0 answers
  1. John Lucas
    John Lucas avatar
    1 posts
    Member since:
    May 2010

    Posted 10 Apr 2011 Link to this post


    I am working on a form to assign learning objectives contained in an XML file to a lesson plan stored in a SQL table.  The source XML file looks like this.

    <ObjectiveSet id="1" description="Firefighter II" parentID="">
        <objective id="2" description="Module A" parentID="1">
            <objective id="3" description="2-1  FIRE DEPARTMENT ORGANIZATION" parentID="2">
                <objective id="4" description="2-1.1  Identify the organization of the fire department. (3-1.1.1)" parentID="3" />
                <objective id="5" description="2-1.2  Identify the firefighter’s role as a member of the organization." parentID="3"/>
                <objective id="6" description="2-1.3  Identify the mission of the fire service and of the local fire department." parentID="3"/>
                <objective id="7" description="2-1.4  Identify the function of standard operating procedures. (3-2.1)" parentID="3"/>
                <objective id="8" description="2-1.5  Identify the fire department’s rules and regulations that apply to the" parentID="3"/>
                <objective id="9" description="2-1.6  Identify the basic components of incident management and the" parentID="3"/>
                <objective id="10" description="2-1.7  Identify the role of other agencies that may respond to emergencies." parentID="3" />
                <objective id="11" description="2-1.8  Identify the components of a member assistance program. (3-1.1.1)" parentID="3"/>
                <objective id="12" description="2-1.9  Identify the components of a member assistance program. (3-1.1.1)" parentID="3"/>       
            <objective id="13" description="FIRE BEHAVIOR" parentID="2">
                <objective id="14" description="Identify the following terms: (3-3.10)" parentID="13">
                    <objective id="15" description="Fire/combustion" parentID="14" />
                    <objective id="16" description="Heat" parentID="14" />
                    <objective id="17" description="Ignition Temperature" parentID="14" />

    I can build the tree with no problem.  I can update the lesson plan record with the selected objective id's from the tree with no problem.

    The ID's from the selected objectives in the XML tree are stored in a SQL table with columns as follows:

    lessonPlanID objectiveID
    1 4
    1 5
    2 17

    When the user goes back another day to edit the objectives for lesson plan one, they will be presented the tree again.  When the page loads, it should appear with the previously assigned objectives already checked.  So, in the example, the tree would have objectiveID 4 and objectiveID 5 already checked.

    I can not figure out how to check the items when the page loads.  I assume it has to do with databinding, instead of using XMLDataSource to build the tree.  I am very new to, so I am not certain how to create the tree and check off the appropriate boxes.

    Is this possible?  Any ideas? 

    Thank you in advance for any thoughts or help that anyone may be able to provide.

  2. Nikolay Tsenkov
    Nikolay Tsenkov avatar
    734 posts

    Posted 14 Apr 2011 Link to this post

    Hi John,

    Could you, please, post the current state of the page you have this tree populated on (markup and code-behind)?

    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top