Class SfListView<TValue>
The SfListView control represents the data in interactive hierarchical structure interface across different layouts or views, that also has features such as data-binding, template, grouping and virtualization.
Inherited Members
Namespace: Syncfusion.Blazor.Lists
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfListView<TValue> : SfBaseComponent
Type Parameters
Name | Description |
---|---|
TValue | The generic type parameter. |
Constructors
SfListView()
Declaration
public SfListView()
Properties
Animation
The Animation
property provides an option to apply different
animations to the ListView component.
Declaration
public AnimationSettings Animation { get; set; }
Property Value
Type | Description |
---|---|
AnimationSettings | Animation settings such as effect, duration and easing. |
CheckBoxPosition
The CheckBoxPosition
is used to set the position of the check box in a list item.
By default, the checkBoxPosition
is Left, which will appear before the text content in a list item.
Declaration
public CheckBoxPosition CheckBoxPosition { get; set; }
Property Value
Type | Description |
---|---|
CheckBoxPosition | Set the position of the check box in a list item. |
CssClass
The CssClass
property is used to add a user-preferred class name in the root element of the ListView,
using which you can customize the component (both CSS and functionality customization).
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the CSS class string separated by space to customize the appearance of component. The default value is empty. |
DataSource
The DataSource
provides the data to render the ListView component which is mapped with the fields of ListView.
Declaration
public IEnumerable<TValue> DataSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TValue> |
Enabled
If Enabled
is set to true, the list items will be enabled.
You can disable the component using this property by setting its value as false.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnablePersistence
Enable or disable persisting component's state between page reloads.
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnableVirtualization
If EnableVirtualization
is set to true, the ListView’s performance will improve when loading a large amount of data.
Declaration
public bool EnableVirtualization { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
GroupTemplate
The ListView has an option to custom design the group header title with the help of the groupTemplate property.
Declaration
public RenderFragment<ComposedItemModel<TValue>> GroupTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<Syncfusion.Blazor.Lists.ComposedItemModel<TValue>> |
HeaderTemplate
The ListView has an option to custom design the ListView header title with the help of the headerTemplate property.
Declaration
public RenderFragment HeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment |
HeaderTitle
The HeaderTitle
is used to set the title of the ListView component.
Declaration
public string HeaderTitle { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. The default value is empty. |
Height
Defines the height of the ListView component.
Declaration
public string Height { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
HtmlAttributes
The HtmlAttributes
allows additional attributes such as id, class, etc., and
accepts n number of attributes in a key-value pair format.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | A dictionary of additional HTML attributes for the root element of the component. |
ID
The ID
property is used as a key to identify our element.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Query
The Query
is used to fetch specific data from the data source by using the where and select keywords.
Declaration
public Query Query { get; set; }
Property Value
Type | Description |
---|---|
Query | The query used with the |
ShowCheckBox
If ShowCheckBox
is set to true, the checkbox will be shown or hidden.
Declaration
public bool ShowCheckBox { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ShowHeader
If ShowHeader
is set to true, the header of the ListView component will be shown or hidden.
Declaration
public bool ShowHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ShowIcon
If ShowIcon
is set to true, the icon of the list item will be shown or hidden.
Declaration
public bool ShowIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
SortOrder
The SortOrder
is used to sort the data source. The available type of sort orders are,
None
- The data source will not be sorted.
Ascending
- The data source will be sorted in ascending order.
Descending
- The data source will be sorted in descending order.
Declaration
public SortOrder SortOrder { get; set; }
Property Value
Type | Description |
---|---|
SortOrder |
Template
The ListView supports customizing the content of each list item with the help of template property.
Declaration
public RenderFragment<TValue> Template { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<TValue> |
Width
Defines the width of the ListView component.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
CheckItemsAsync(IEnumerable<TValue>)
Check the items in ListView To check the specific listItem by passing the fields like : TValue { fieldName: fieldValue } To check all the listItem by passing empty argument.
Declaration
public Task CheckItemsAsync(IEnumerable<TValue> listItems = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TValue> | listItems | Specifies the list items arguement. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
DisableItemAsync(TValue)
Disables the list items by passing the Id and text fields. listItem like fields: TValue { fieldName: fieldValue }.
Declaration
public Task DisableItemAsync(TValue listItem)
Parameters
Type | Name | Description |
---|---|---|
TValue | listItem | Specifies the list item arguement. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
EnableItemAsync(TValue)
Enables the disabled list items by passing the Id and text fields. listItem like fields: TValue { fieldName: fieldValue }.
Declaration
public Task EnableItemAsync(TValue listItem)
Parameters
Type | Name | Description |
---|---|---|
TValue | listItem | Specifies the list item arguement. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
GetCheckedItemsAsync()
Gets the details of the currently checked item from the list items.
Declaration
public Task<SelectedItems<TValue>> GetCheckedItemsAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<SelectedItems<TValue>> | Task. |
GetPropertyStyle()
Get style Attributes value.
Declaration
protected string GetPropertyStyle()
Returns
Type | Description |
---|---|
System.String | returns property styles. |
OnAfterRenderAsync(Boolean)
Method invoked after each time the component has been rendered.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | Set to true for the first time component rendering; otherwise gets false. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Overrides
OnInitialized()
Method invoked when the component is ready to start.
Declaration
protected override void OnInitialized()
OnParametersSetAsync()
Method invoked when any changes in component state occurs.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
RemoveItems(IEnumerable<TValue>)
Removes item(s) from the ListView by passing the array of field objects. listItems like fields: TValue { fieldName: fieldValue }.
Declaration
public void RemoveItems(IEnumerable<TValue> listItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TValue> | listItems | Specifies the list items arguement. |
UncheckItemsAsync(IEnumerable<TValue>)
Uncheck the items in ListView. To uncheck the specific listItem by passing the fields like : TValue { fieldName: fieldValue }. To uncheck all the listItem by passing empty argument.
Declaration
public Task UncheckItemsAsync(IEnumerable<TValue> listItems = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TValue> | listItems | Specifies the list item arguement. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
UpdateListViewDataSource(Boolean, IEnumerable<TValue>)
Updates listview datasource.
Declaration
protected void UpdateListViewDataSource(bool updateSortedData = false, IEnumerable<TValue> dataSource = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | updateSortedData | specifies the update sorted data. |
System.Collections.Generic.IEnumerable<TValue> | dataSource | specifies the data source. |