I've created a simple unbound row which display the sum of all integers in a column. When the unbound row is not shown within the data grid view, and any value is edited, the sum in the unbound row is not updated right away. When I hit the remove item button until the unbound row at the bottom comes into view, at one point the value shown wouldn't be updated.
To reproduce:
Result: The value shown in unbound row remains as the value in Step 1 and it will only be updated when the scrollbar is clicked.
Currently, we are
checking the feasibility to achieve your requirement. We need two more business
days to validate this. We will update you with further details on November 09,
2022.
Still, we are checking the feasibility to achieve your requirement. We will update you with further details on November 11, 2022.
Still, we are checking the feasibility to resolve the reported issue at the sample level. We need two more business days to validate this. We will check and update you with further details on November 15, 2022.
As we mentioned earlier, the unbound row values do not update automatically while modifying the data. We need to update this manually, currently, we are checking the possible way to achieve your requirement at the sample level. We will update you with further details on November 18, 2022.
Alison Tan, On further analysis, you can achieve your requirement to update the unbound row values while changing the dependent data values will be achievable by overriding the OnRender method by using the custom renderer shown below,
this.sfDataGrid1.UnboundRowCellRenderers.Remove("UnboundRowCell"); this.sfDataGrid1.UnboundRowCellRenderers.Add("UnboundRowCell", new UnboundCellRenderer()); {
protected override void OnRender( Graphics paint, Rectangle cellRect, string cellValue, CellStyleInfo style, DataColumnBase column, RowColumnIndex rowColumnIndex) { if (column.GridColumn.MappingName == "Price") { ObservableCollection<OrderInfo> dataGridOrders = (column.UnboundRowInfo.OriginalSender as SfDataGrid).DataSource as ObservableCollection<OrderInfo>; cellValue = dataGridOrders.Sum(items => items.Price).ToString("0.00"); } base.OnRender(paint, cellRect, cellValue, style, column, rowColumnIndex); } } |
Here we have modified the provided sample based on your scenario. Please have a
look at this.
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.