Class PullToRefreshView
Represents a customized view that loads data when an end-user pulls the grid down to refresh.
Inheritance
Namespace: Syncfusion.SfDataGrid
Assembly: Syncfusion.SfDataGrid.Android.dll
Syntax
public class PullToRefreshView : ProgressBar
Constructors
PullToRefreshView(Context, IAttributeSet, Int32)
Initializes a new instance of the PullToRefreshView class.
Declaration
public PullToRefreshView(Context context, IAttributeSet attributeSet, int definedStyle)
Parameters
Type | Name | Description |
---|---|---|
Android.Content.Context | context | The Android.Content.Context. |
Android.Util.IAttributeSet | attributeSet | The Android.Util.IAttributeSet. |
System.Int32 | definedStyle | The value indicating the defined style. |
Properties
IsBusy
Gets or sets a value indicating whether the grid is busy in refreshing the underlying data by executing the RefreshCommand.
Declaration
public bool IsBusy { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The boolean value indicating whether the grid is busy in refreshing the underlying data. |
Remarks
The pull to refresh view will be in busy state, in the mean time pull to refresh command is executed, Refer the below code example in which the IsBusy state is set as true before executing the RefreshCommand and set as false, once the command is executed.
The busy state of the pull to refresh view can also be tracked by the IsBusy property.
Examples
DataGrid.AllowPullToRefresh = true;
DataGrid.PullToRefreshView.RefreshCommand = new Command(ExecutePullToRefreshCommand);
private async void ExecutePullToRefreshCommand()
{
DataGrid.PullToRefreshView.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.ItemsSourceRefresh ();
DataGrid.PullToRefreshView.IsBusy = false;
}
//Command.cs
public class Command : ICommand
{
}
See Also
Progress
Gets or sets the progress of pulling in the pull to refresh view can be tracked using this property. Once, the pulling progress is reached 100 %, PullToRefreshCommand fires, executing the command to be performed when the grid is pulled down for refreshing.
Declaration
public override int Progress { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The progress of pulling in the pull to refresh view. |
Remarks
The user can manually refresh the grid in runtime by setting the Progress to 100.
Examples
DataGrid.PullToRefreshView.Progress = 100;
RefreshCommand
Gets or sets the command to be executed when performing the pulling operation to refresh the grid. You must set this property to an System.Windows.Input.ICommand and the property to true to enable pulling operation in SfDataGrid. This command will be fired upon performing the pulling operation for doing the refreshing operation.
Declaration
public ICommand RefreshCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when PullToRefresh action is performed. |
Remarks
SfDataGrid provides an option to refresh it when performing the pulling action. RefreshCommand will be fired to refresh (add, delete or modify the underlying data) the grid. A busy indicator will be displayed to denote the refreshing operation.
The pull to refresh command can also be set using PullToRefreshCommand property.
Examples
DataGrid.AllowPullToRefresh = true;
DataGrid.PullToRefreshView.RefreshCommand = new Command(ExecutePullToRefreshCommand);
private async void ExecutePullToRefreshCommand()
{
this.DataGrid.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.ItemsSourceRefresh ();
this.DataGrid.IsBusy = false;
}
//Command.cs
public class Command : ICommand
{
}