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

[Solved] Model Data Binding doesn't not display any content

0 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
HaBo
Top achievements
Rank 1
HaBo asked on 14 Oct 2011, 02:20 AM
I have a View Which call an Action 

@Html.Action("CurrentMedication", "Medication", new { PatientID = ViewBag.PatientID, CustomerID = ViewBag.CustomerID, LocationID = ViewBag.LocationID })


and the Controller is like below

   
[GridAction]
        public ActionResult CurrentMedication(int PatientID, int CustomerID, int LocationID)
        {
            ViewBag.Title = "CurrentMedication";
            var ml = new MedicationModel();
            List<MedicationModel> CM = ml.GetCurrentMedication(PatientID, CustomerID, LocationID);
           // return PartialView("_MedicationsGrid", new GridModel(CM));
            return PartialView("_MedicationsGrid", CM);
        }



and My Partial view is as Below

@using Telerik.Web.Mvc.UI
@model IEnumerable<HRORx.Models.MedicationModel>
@(Html.Telerik().Grid<HRORx.Models.MedicationModel>()
        .Name("CurrentMedication")
        .Columns(columns =>
        {
            columns.Bound(e => e.PrescriptionID).Width(100);
            columns.Bound(e => e.Medication).Width(140);
            columns.Bound(e => e.RxType).Width(100);
            columns.Bound(e => e.StartDate).Width(150);
            columns.Bound(e => e.EndDate).Width(150);
        })
            .DataBinding(dataBinding =>
            {
                dataBinding.Ajax().Select("CurrentMedication", "Medication").Enabled(true);
            })
            .Sortable(sorting => sorting.Enabled(true))
            .Pageable(paging => paging.Enabled(true))
            .Groupable(grouping => grouping.Enabled(true))
            .Footer(true)
    )



When i Put Break Point in my partial View and count check the Model Count i see there are 5 results.

But that values are not binding to the Grid.

Can Any one help me with this.
Tags
Grid
Asked by
HaBo
Top achievements
Rank 1
Share this question
or