This is a migrated thread and some comments may be shown as answers.
MVC TreeView Control - Load on Demand Three Levels Deep
3 Answers 88 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Philip
Top achievements
Rank 1
Philip asked on 14 Jun 2010, 12:35 AM
I am using MVC 2 and the latest build of the Telerik MVC Extensions with VS2008. I can successfully display a TreeView two levels deep with the code snippets below:  I am trying to create a TreeView three levels deep.but I can't figure out the syntax.  Can you please provide an example or add pseudo code to the snippets below?.

Thanks,

--------------------------------------------------------------------------------------
VIEW
<%= Html.Telerik().TreeView().Name("AjaxTreeView")
        .BindTo(
                 Model, (item, patient) =>
                 {
                     item.Text = patient.study_patient_no + " " + patient.STUDY_PATIENT_INITIALS;
                     item.Value = patient.study_patient_id.ToString();
                     item.LoadOnDemand = true;
                 }
               )
         .DataBinding(dataBinding => dataBinding
         .Ajax().Select("_AjaxLoading", "Home"))
%>

CONTROLLER
// Top level of the TreeView
public ActionResult Patients()
{
           List<ic_stdy_patient_status_getResult> listOfPatients = GetPatients();

           ViewData.Model = listOfPatients;
           return View("PatientCasebook");
}


// Second Level of the TreeView
[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult _AjaxLoading(TreeViewItemModel node)
        {
            //Get the ID of the selected patient returned by the TreeView control
            int studyPatientId = Convert.ToInt32(node.Value);

            return new JsonResult { Data = GetThisPatientsEvents(studyPatientId) };
        }

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 15 Jun 2010, 07:26 AM
Hello Philip,

There was a known issue with a missing hidden input for the value in the 2010.1.309 version of Telerik Components for ASP.NET MVC. Could you please try with the version of the components attached to this forum thread ?

Regards,
Georgi Krustev
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.
0
Philip
Top achievements
Rank 1
answered on 15 Jun 2010, 12:19 PM
Hi Georgi,

FYI, I am running running version 2010.1.518 (which I believe is the latest release of Telerik extensions for MVC). You asked me to install version 2010.1.416 I believe.  You probably don't want me to install the earlier version, so I thought I would ask before proceeding.

Thanks,
Philip 
0
Georgi Krustev
Telerik team
answered on 15 Jun 2010, 12:48 PM
Hello Philip,

You are right- 2010.1.518 is the latest official version of Telerik Components for ASP.NET MVC.

Unfortunately, I am not able to determine, where could be the problem depending on the given information - code snippets looks correct. Could you please debug your project and verify that the _AjaxLoading Action method is called when you try to expand the some of the second level nodes in order to load child nodes.

If the problem still persists, I will ask you a simple test project which reproduces the depicted issue.

Best wishes,
Georgi Krustev
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
General Discussions
Asked by
Philip
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Philip
Top achievements
Rank 1
Share this question
or