What Changed
We renamed the following field-related properties:
DataGridHtmlDataCellDecorationEventArgs<T>.Field
->DataGridHtmlDataCellDecorationEventArgs<T>.FieldName
DataGridHtmlGroupRowDecorationEventArgs<T>.GroupField
->DataGridHtmlGroupRowDecorationEventArgs<T>.GroupFieldName
Reasons for Change
To avoid ambiguous interpretation of API member names.
Impact on Existing Apps
This change affects your application if you use any of the mentioned properties in the application code:
Razor<DxDataGrid Data="@DataSource"
HtmlDataCellDecoration="@OnHtmlDataCellDecoration"
HtmlRowDecoration="@OnHtmlRowDecoration">
<DxDataGridColumn Field="@nameof(Order.Product)"></DxDataGridColumn>
...
</DxDataGrid>
@code {
IEnumerable<Product> DataSource;
DxDataGrid<Vacancy> grid;
void OnHtmlDataCellDecoration(DataGridHtmlDataCellDecorationEventArgs<Order> eventArgs) {
if (eventArgs.Field == nameof(Order.Product))
eventArgs.Style += " background-color: rgb(169, 148, 200); color: black;";
}
void OnHtmlRowDecoration(DataGridHtmlRowDecorationEventArgs<Vacancy> eventArgs) {
if (eventArgs is DataGridHtmlGroupRowDecorationEventArgs<Vacancy> groupEventArgs)
if (grid.SingleSelectedDataRow != null) {
if (groupEventArgs.GroupField == "Region" && (string)groupEventArgs.GroupKey == grid.SingleSelectedDataRow.Region)
groupEventArgs.CssClass += " table-primary";
}
}
}
How to Update Existing Apps
In the scenario above, update the application code as follows:
Razor<DxDataGrid Data="@DataSource"
HtmlDataCellDecoration="@OnHtmlDataCellDecoration"
HtmlRowDecoration="@OnHtmlRowDecoration">
<DxDataGridColumn Field="@nameof(Order.Product)"></DxDataGridColumn>
...
</DxDataGrid>
@code {
IEnumerable<Product> DataSource;
DxDataGrid<Vacancy> grid;
void OnHtmlDataCellDecoration(DataGridHtmlDataCellDecorationEventArgs<Order> eventArgs) {
if (eventArgs.FieldName == nameof(Order.Product))
eventArgs.Style += " background-color: rgb(169, 148, 200); color: black;";
}
void OnHtmlRowDecoration(DataGridHtmlRowDecorationEventArgs<Vacancy> eventArgs) {
if (eventArgs is DataGridHtmlGroupRowDecorationEventArgs<Vacancy> groupEventArgs)
if (grid.SingleSelectedDataRow != null) {
if (groupEventArgs.GroupFieldName == "Region" && (string)groupEventArgs.GroupKey == grid.SingleSelectedDataRow.Region)
groupEventArgs.CssClass += " table-primary";
}
}
}