Back to Devexpress

DashboardConfigurator.ConfigureDataReloadingTimeout Event

dashboard-devexpress-dot-dashboardweb-dot-dashboardconfigurator-711b1b4a.md

latest5.5 KB
Original Source

DashboardConfigurator.ConfigureDataReloadingTimeout Event

Allows you to set a time interval that specifies how frequently the Web Dashboard refreshes its in-memory cache when a user sends a data request.

Namespace : DevExpress.DashboardWeb

Assembly : DevExpress.Dashboard.v25.2.Web.dll

NuGet Package : DevExpress.Web.Dashboard.Common

Declaration

csharp
public event ConfigureDataReloadingTimeoutWebEventHandler ConfigureDataReloadingTimeout
vb
Public Event ConfigureDataReloadingTimeout As ConfigureDataReloadingTimeoutWebEventHandler

Event Data

The ConfigureDataReloadingTimeout event's data class is ConfigureDataReloadingTimeoutWebEventArgs. The following properties provide information specific to this event:

PropertyDescription
DashboardIdGets the identifier of the current dashboard.
DataMemberGets the identifier of a corresponding data member in the data source.
DataReloadingTimeoutGets or sets a time interval that is the data reloading timeout.
DataSourceNameGets the data source’s ComponentName for which the event was raised.

Remarks

Tip

For information on how to use the DashboardConfigurator‘s API, see the following topic: Server-Side API Overview.

The Web Dashboard allows you to set a time interval that specifies how frequently the Web Dashboard refreshes its cache when a user sends a data request. Handle the ConfigureDataReloadingTimeout event to change this time interval.

For instance, if you set the ConfigureDataReloadingTimeoutWebEventArgs.DataReloadingTimeout event parameter to 100 seconds, the Web Dashboard updates the cache when a new request is received and the current cache version was created more than 100 seconds ago. The cached data is disposed of and new data is loaded instead.

Note

DataReloadingTimeout defines a time interval during which a cache record exists, measured from the moment it is created. To prevent memory leaks, the Web Dashboard control also limits the lifetime of each cache record to 300 seconds from the moment it was last accessed. If a cache record is not accessed within 300 seconds, it is marked as stale and removed from the cache.

To learn how the Web Dashboard manages its in-memory cache, see the following help topic: Manage an In-Memory Data Source Cache in ASP.NET Web Forms.

The following code snippet sets a data reload timeout for a specific data source:

csharp
private void Default_ConfigureDataReloadingTimeout(object sender, ConfigureDataReloadingTimeoutWebEventArgs e) {
  if (e.DataSourceName == "sqlDataSource") {
      e.DataReloadingTimeout = TimeSpan.FromSeconds(5);
  }            
}
vb
Private Sub Default_ConfigureDataReloadingTimeout(ByVal sender As Object, ByVal e As ConfigureDataReloadingTimeoutWebEventArgs)
  If e.DataSourceName = "sqlDataSource" Then
      e.DataReloadingTimeout = TimeSpan.FromSeconds(5)
  End If
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ConfigureDataReloadingTimeout event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

mvc-dashboard-obtain-data-from-online-spreadsheets/CS/MvcDashboard/App_Start/DashboardConfig.cs#L47

csharp
DashboardConfigurator.Default.ExcelDataSourceBeforeFill += DefaultOnExcelDataSourceBeforeFill;
DashboardConfigurator.Default.ConfigureDataReloadingTimeout += (s, e) => {
    e.DataReloadingTimeout = TimeSpan.FromSeconds(30);

See Also

DashboardConfigurator Class

DashboardConfigurator Members

DevExpress.DashboardWeb Namespace