Breaking Change T921348
Visible to All Users

Data Grid field-related properties have been renamed

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"; } } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.