This question is locked. New answers and comments are not allowed.
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) };
}
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) };
}