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

Problem in binding data thru ViewData

0 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 06 Nov 2012, 11:57 AM
Hello,

I am binding the grid with the help of Viewdata. And when I update the View data it is not getting updated to the Grid, it is showing only the previous data. this is happening even for the dropdownlist also. what is the probelm in my code? please find my code below.

@{Html.Kendo().Grid((List<BNYM.EnSIS.Pricing.Contract.VendorPricingGridResponse>)ViewData["PricingGrid"])
.Name("PricingGrid")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(25)
.Batch(true)
.ServerOperation(true)
.Model(q => q.Id(m => m.ProductID))
.Model(q => q.Id(m => m.CurrencyCode))

)

.Columns(columns =>

{
columns.Bound(m => m.Category).Title("Category").Width(90);
columns.Bound(m => m.ProductID).Title("ProductID").Width(140);
columns.Bound(m => m.CurrencyCode).Title("USD").Width(50);
})

.Resizable(resizing => resizing.Columns(true))
.Scrollable(scrolling => scrolling.Enabled(true).Height(600))
.Sortable(sorting => sorting.Enabled(true))
.Groupable(grouping => grouping.Enabled(true))
.Filterable(filtering => filtering.Enabled(true))
.Reorderable(reorder => reorder.Columns(true))
.Pageable(Pageable => Pageable.Enabled(true).PreviousNext(true).Input(true).PageSizes(true).Refresh(true))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.ProductID))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.CurrencyCode))
.Selectable(s => s.Mode(GridSelectionMode.Single).Enabled(true))

 
.Render();

}



Regards,
Ravi

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Ravi
Top achievements
Rank 1
Share this question
or