Class LoadMoreView
Represents a customized Xamarin.Forms.View that loads new data items in runtime.
Inheritance
Implements
Namespace: Syncfusion.SfDataGrid.XForms
Assembly: Syncfusion.SfDataGrid.XForms.dll
Syntax
public class LoadMoreView : Layout<View>, IDisposable
Remarks
A LoadMoreView represents a customized Xamarin.Forms.View that is loaded either at the top or bottom based on the LoadMorePosition property.
LoadMore option can be enabled in a SfDataGrid control, by setting the AllowLoadMore property to true and by setting the LoadMoreCommand property. When the LoadMore is enabled, the SfDataGrid provides an option to load a subset of data to its data source in the runtime using the LoadMoreCommand.
Constructors
LoadMoreView()
Initializes a new instance of the LoadMoreView class.
Declaration
public LoadMoreView()
Properties
LoadMoreCommand
Gets or sets the command to be executed when an end-user taps the LoadMoreView to load new data items in SfDataGrid.
Declaration
public ICommand LoadMoreCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to be executed when load more view is clicked. |
Remarks
SfDataGrid allows to load more items in the SfDataGrid, when the last data of the collection is reached, by executing the LoadMoreCommand when an end-user taps the LoadMoreView of SfDataGrid.
Examples
dataGrid.AllowLoadMore = true;
dataGrid.LoadMoreView.LoadMoreCommand = new Command(ExecuteLoadMoreCommand);
private async void ExecuteLoadMoreCommand()
{
this.dataGrid.IsBusy = true;
await Task.Delay(new TimeSpan(0, 0, 5));
viewModel.LoadMoreItems();
this.dataGrid.IsBusy = false;
}
See Also
Methods
Dispose()
Perform final clean up before it is released from memory.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | if true - release both managed and unmanaged resources; if false - release only unmanaged resources. |
InitLoadMore()
Initializes the required properties for the LoadMoreView.
Declaration
protected virtual void InitLoadMore()
LayoutChildren(Double, Double, Double, Double)
Positions and sizes the children of the LoadMoreView.
Declaration
protected override void LayoutChildren(double x, double y, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | A value that represents the x coordinate of the child. |
System.Double | y | A value that represents the y coordinate of the child. |
System.Double | width | A value that represents the width of the child. |
System.Double | height | A value that represents the height of the child. |
OnMeasure(Double, Double)
This method is called during the measure pass of a layout cycle to get the desired size of an element.
Declaration
protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | The available width for the element to use. |
System.Double | heightConstraint | The available height for the element to use. |
Returns
Type | Description |
---|---|
Xamarin.Forms.SizeRequest | A Xamarin.Forms.SizeRequest which contains the desired size of the element. |
UpdateLoadMoreStyle(DataGridStyle)
Updates the style of the LoadMoreView.
Declaration
protected virtual void UpdateLoadMoreStyle(DataGridStyle style)
Parameters
Type | Name | Description |
---|---|---|
DataGridStyle | style | The DataGridStyle. |