I wanted to add 3 Custom buttons or icons for different functionalities in single column of each row in a grid . when we click on each button we should be able to get the row data and that button click should be restricted to only particular row and it should not effect other rows.
|
SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" EditType="EditType.DatePickerEdit" Format="d" TextAlign="TextAlign.Right" Width="130" Type="ColumnType.Date"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn HeaderText="Employee Image" TextAlign="TextAlign.Center" Width="120">
<Template>
@{
var employee = (context as Order);
<div class="image">
<SfButton IconCss="e-icons e-chevron-down-fill" OnClick="@(()=>Clicked(employee))"></SfButton>
<SfButton IconCss="e-icons e-chevron-down-fill" OnClick="@(()=>Clicked(employee))"></SfButton>
<SfButton IconCss="e-icons e-chevron-down-fill" OnClick="@(()=>Clicked(employee))"></SfButton>
</div>
}
</Template>
</GridColumn>
</GridColumns>
</SfGrid>
@code{
SfGrid<Order> Grid { get; set; }
public List<Order> Orders { get; set; }
public void Clicked(Order val)
{
}
|