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

[Solved] Grid caching issue

1 Answer 35 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.
Caitriona
Top achievements
Rank 1
Caitriona asked on 25 Mar 2010, 03:16 PM

Hello!

I have a Telerik Grid (grid2) inside a Telerik tabStrip. The code that populates this grid is in the action "LicenceInformation" in the SystemAdminTab controller. The content in this grid is controlled by a selection on another grid (grid1) in the same page but a different control. Please See Diagram.

When the page loads for the first time as I select a row (for the first time) in grid1 the action "LicenceInformation" is executed the content of grid 2 changes. If I then select any row again “LicenceInformation" is not executed and the previous information for this row is displayed.

Therefore if I then change the content of grid2 and select a row that was previously selected in grid1 the new content is not displayed. It does not perform the action "LicenceInformation" in the SystemAdminTab controller and just shows the old information. The only way to see the new information is to restart the application.

It this a caching problem ? If so is there any way to stop this caching and force the page to refresh?

Thank you in advance for your help!

<% Html.Telerik().TabStrip()

.Name("TabStrip")

.Items(parent =>

{

parent.Add()

.Text("Customer Licence information")//See Customer.aspx for .Text(ViewData["txtCustomerDetails"].ToString())

.LoadContentFrom("LicenceInformation", "SystemAdminTab", new { customerID = 2, serviceProviderID = Model.ServiceProviderId })

.Selected(true);

.
.
.

.SelectedIndex(1)//(int)ViewData["tabIndex"])

.HtmlAttributes(new { @style = "Height:100%" })

.Render();

%>

1 Answer, 1 is accepted

Sort by
0
Caitriona
Top achievements
Rank 1
answered on 26 Mar 2010, 04:20 PM
Hello,

Well I have sorted the issue by putting the following code (seen in bold) at the end of my grid:

<%

= Html.Telerik().Grid(Model)

 

.Name(

"Licences")

 

.Columns(columns =>

{

columns.Add(t => t.SupportContactQuantity).Width(

"100px").Title("Test").Visible(true);

 

columns.Add(o => o.TreatmentShortname).Title(

"Test");

 

columns.Add(o => o.LicenceStartDate).Format(

"{0:dd/MM/yyyy}").Title("Test").Width("5");

 

columns.Add(o => o.LicenceEndDate).Format(

"{0:dd/MM/yyyy}").Title("Test").Width("5");

 

columns.Add(o => o.Unlimited).Title(

"Test").Width("5");

 

columns.Add(o => o.LicenceQuantity).Title(

"Test").Width("5");

 

columns.Add(o => o.LicenceQuantityUsed).Title(

"Test").Width("5");

 

})

.Sortable()

.DataBinding(dataBinding => dataBinding.Ajax().Select(

"_AjaxBinding", "SystemAdminTab", new { id = Convert.ToInt32(ViewData["ServiceProviderId"]) }))

 

.Filterable()

.Pageable(paging => paging.PageSize(20))

.Sortable()



This fires the following action which causes the data to refresh:

[

GridAction]

 

 

public ActionResult _AjaxBinding(int serviceProviderId)

 

{

 

    return View(new GridModel<LicenceView>

 

    {

        Data = _licenceService.GetLicenceInformationForServiceProviderId(

Convert.ToInt32(serviceProviderId))

 

    });

}



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