I have a RadzenDataGrid that has a series of columns with data, one of this is a string that I want to represent as a textbox so the user can input data and then when clicking a "submit" execute the stored procedure that updated these fields, I don't understand how to do the 2 way binding as it's giving me error when I try to ad the "@bind-Value=@Comments" property.
my datagrid has the following:
<RadzenDataGrid AllowSorting="true" AllowColumnReorder="true" AllowMultiColumnSorting="true" PageSize="40" AllowFiltering="true" FilterMode="FilterMode.Simple" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" Data="@FilteredExpendituresList" TItem="Expenditure" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true">
<Columns>
<RadzenDataGridColumn TItem="Expenditure" Property="EmployeeName" Title="Employee Name" Visible=@FilteredExpendituresList.Any(x=>x.EmployeeName is not null) />
<RadzenDataGridColumn TItem="Expenditure" Property="EmployeeNumber" Title="Employee Number" Sortable="false" Width="125px" Visible=@FilteredExpendituresList.Any(x=>x.EmployeeNumber is not null) TextAlign="TextAlign.Center"/>
<RadzenTextBox @bind-Value=@Comment Class="w-100" />
</Columns>
</RadzenDataGrid>
and my object filling receives:
[Parameter]
public IEnumerable<Expenditure> FilteredExpendituresList { get; set; } = null!;
with the class being:
public class Expenditure
{
public string EmployeeName { get; set; }
public string EmployeeNumber { get; set; }
public string Comment { get; set; }
}
How should I do so the datagrid can have the 2 way binding and have the Comment field that is input being passed from the textbox to the object?