LgGridSelectMultipleColumn
LgGridSelectMultipleColumn<TColumnValue, TDataSourceItem> edits and filters a collection of values from a shared data source.
<Columns Context="item">
<LgGridSelectMultipleColumn @bind-Value="item.TagIds"
Title="#Tags"
DataSource="_tagDataSource"
VisibleItemCount="8" />
</Columns>
- NuGet package :
Lagoon.UI.GridView
Common parameters are documented in LgGridBaseColumn.
Usage
Demonstration
Try this component in the Lagoon showcase.
Multiple selection list
GridSelectMultipleColumnPage.razor
@inherits LgPage
<LgGridView StateId="orders-select-multiple-column"
Items="_orders"
EditMode="GridEditMode.Cell"
Exportable="true"
Title="#OrdersGridTitle">
<Columns Context="item">
<LgGridTextColumn @bind-Value="item.Number" Title="#OrderNumber" />
<LgGridSelectMultipleColumn @bind-Value="item.TagIds"
Title="#Tags"
DataSource="_tagDataSource"
ExportFormat="ExportSelectFormat.Text"
ResetButton="true"
VisibleItemCount="3" />
</Columns>
</LgGridView>
GridSelectMultipleColumnPage.razor.cs
public partial class GridSelectMultipleColumnPage : LgPage
{
// Choice source used for editing, display, and multiple filtering.
private readonly TagDataSource _tagDataSource = new(new List<TagItem>
{
new() { Id = 1, Label = "#Urgent" },
new() { Id = 2, Label = "#Internal" },
});
}
public sealed class TagDataSource : ListDataSource<TagItem, int>
{
public TagDataSource(List<TagItem> items) : base(items)
{ }
// Label displayed for each selected value.
public override string GetItemText(TagItem item)
{
return item.Label;
}
// Persistent identifier stored in the list linked to the row.
public override int GetItemValue(TagItem item)
{
return item.Id;
}
}
public sealed class TagItem
{
public int Id { get; set; }
public string Label { get; set; }
}
Filter
Multiple selection filter.
Associated enumerations
ExportSelectFormat
Export format for selection items (property ExportFormat).
| Value | Description |
|---|---|
Text | Exports the displayed text of the item (default value of export configuration). |
Value | Exports the value of the item. |
Inherited editing modes (GridEditMode) are documented in LgGridView.
Complete reference
Reference generated from the sources: API reference — LgGridSelectMultipleColumn.
Related components
LgGridView— the data grid hosting the column.LgGridTextColumn— base column and inherited common parameters.LgGridSelectColumn— single-value variant.LgGridEnumListColumn— for a list of enumeration values.