WinUI

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridCaptionSummaryCellRenderer

    Show / Hide Table of Contents

    Class GridCaptionSummaryCellRenderer

    Represents a class that maintains the rendering of GridCaptionSummaryCell.

    Inheritance
    System.Object
    GridCellRendererBase
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>
    GridCaptionSummaryCellRenderer
    Implements
    IGridCellRenderer
    System.IDisposable
    Inherited Members
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.TextAlignmentToHorizontalAlignment(TextAlignment)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.CurrentRendererValueChanged()
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnInitializeTemplateElement(DataColumnBase, ContentControl, Object)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUpdateTemplateBinding(DataColumnBase, ContentControl, Object)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnInitializeDisplayElement(DataColumnBase, GridCaptionSummaryCell, Object)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUpdateDisplayBinding(DataColumnBase, GridCaptionSummaryCell, Object)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnInitializeEditElement(DataColumnBase, GridCaptionSummaryCell, Object)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUpdateEditBinding(DataColumnBase, GridCaptionSummaryCell, Object)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.UpdateToolTip(DataColumnBase)
    GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>.EditorType
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnPrepareUIElements(DataColumnBase, Object, Boolean)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.BeginEdit(RowColumnIndex, FrameworkElement, GridColumn, Object)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnEnteredEditMode(DataColumnBase, FrameworkElement)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.EndEdit(DataColumnBase, Object, Boolean)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnEditingComplete(DataColumnBase, FrameworkElement)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUnloadUIElements(DataColumnBase)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnArrange(RowColumnIndex, FrameworkElement, Rect)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnMeasure(RowColumnIndex, FrameworkElement, Size)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUpdateStyleInfo(DataColumnBase, Object)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnCreateEditUIElement()
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnCreateDisplayUIElement()
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.InitializeEditElement(DataColumnBase, GridCaptionSummaryCell, Object)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.InitializeDisplayElement(DataColumnBase, GridCaptionSummaryCell, Object)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.InitializeTemplateElement(DataColumnBase, ContentControl, Object)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnWireDisplayUIElement(GridCaptionSummaryCell)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUnwireDisplayUIElement(GridCaptionSummaryCell)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnWireTemplateUIElement(ContentControl)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUnwireTemplateUIElement(ContentControl)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnWireEditUIElement(GridCaptionSummaryCell)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnUnwireEditUIElement(GridCaptionSummaryCell)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnEditElementLoaded(Object, RoutedEventArgs)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnEditElementUnloaded(Object, RoutedEventArgs)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.OnEditElementLostFocus(Object, RoutedEventArgs)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.InitializeCellStyle(DataColumnBase, Object)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.ClearRecycleBin()
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.Dispose(Boolean)
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.DisplayRecycleBin
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.EditRecycleBin
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.TemplateRecycleBin
    GridVirtualizingCellRendererBase<GridCaptionSummaryCell, GridCaptionSummaryCell>.AllowRecycle
    GridCellRendererBase.OnPrepareUIElements(DataColumnBase, Object, Boolean)
    GridCellRendererBase.OnPrepareUIElements()
    GridCellRendererBase.OnPreviewTextInput(KeyRoutedEventArgs)
    GridCellRendererBase.CanValidate()
    GridCellRendererBase.CanUpdateBinding(GridColumn)
    GridCellRendererBase.CommitUnboundCellValue(Object, GridColumn, Object)
    GridCellRendererBase.UpdateToolTip(DataColumnBase)
    GridCellRendererBase.OnArrange(RowColumnIndex, FrameworkElement, Rect)
    GridCellRendererBase.OnMeasure(RowColumnIndex, FrameworkElement, Size)
    GridCellRendererBase.OnUnloadUIElements(DataColumnBase)
    GridCellRendererBase.OnUpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridCellRendererBase.OnUpdateStyleInfo(DataColumnBase, Object)
    GridCellRendererBase.ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)
    GridCellRendererBase.SetFocus(FrameworkElement, Boolean)
    GridCellRendererBase.IGridCellRenderer.ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)
    GridCellRendererBase.Arrange(RowColumnIndex, FrameworkElement, Rect)
    GridCellRendererBase.Measure(RowColumnIndex, FrameworkElement, Size)
    GridCellRendererBase.PrepareUIElements(DataColumnBase, Object, Boolean)
    GridCellRendererBase.UnloadUIElements(DataColumnBase)
    GridCellRendererBase.IGridCellRenderer.UpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridCellRendererBase.UpdateBindingInfo(DataColumnBase, Object, Boolean)
    GridCellRendererBase.UpdateCellStyle(DataColumnBase, Object)
    GridCellRendererBase.PreviewTextInput(KeyRoutedEventArgs)
    GridCellRendererBase.GetControlValue()
    GridCellRendererBase.SetControlValue(Object)
    GridCellRendererBase.SetCurrentCellState(RowColumnIndex, FrameworkElement, Boolean, Boolean, GridColumn, DataColumnBase)
    GridCellRendererBase.UpdateCurrentCellState(FrameworkElement, Boolean)
    GridCellRendererBase.ResetCurrentCellState()
    GridCellRendererBase.SetFocus(Boolean)
    GridCellRendererBase.BeginEdit(RowColumnIndex, FrameworkElement, GridColumn, Object)
    GridCellRendererBase.EndEdit(DataColumnBase, Object, Boolean)
    GridCellRendererBase.UpdateSource(FrameworkElement)
    GridCellRendererBase.ClearRecycleBin()
    GridCellRendererBase.Dispose()
    GridCellRendererBase.Dispose(Boolean)
    GridCellRendererBase.PreviewInputText
    GridCellRendererBase.DataGrid
    GridCellRendererBase.BindingExpression
    GridCellRendererBase.SupportsRenderOptimization
    GridCellRendererBase.UseOnlyRendererElement
    GridCellRendererBase.HasCurrentCellState
    GridCellRendererBase.CurrentCellIndex
    GridCellRendererBase.CurrentCellElement
    GridCellRendererBase.CurrentCellRendererElement
    GridCellRendererBase.IsInEditing
    GridCellRendererBase.IsFocused
    GridCellRendererBase.IsEditable
    GridCellRendererBase.IsFocusible
    GridCellRendererBase.IsDropDownable
    Namespace: Syncfusion.UI.Xaml.DataGrid.Renderers
    Assembly: Syncfusion.Grid.WinUI.dll
    Syntax
    public class GridCaptionSummaryCellRenderer : GridVirtualizingCellRenderer<GridCaptionSummaryCell, GridCaptionSummaryCell>, IGridCellRenderer, IDisposable
    Examples
    this.sfDataGrid.CellRenderers.Remove("CaptionSummary");
    this.sfDataGrid.CellRenderers.Add("CaptionSummary", new GridCaptionSummaryCellRendererExt());
    public class GridCaptionSummaryCellRendererExt : GridCaptionSummaryCellRenderer
    {
       public override void OnUpdateEditBinding(Syncfusion.UI.Xaml.DataGrid.DataColumnBase dataColumn, Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell element, object dataContext)
       {
           if (element.DataContext is Group && this.DataGrid.View.GroupDescriptions.Count > 0)
           {
               var groupRecord = element.DataContext as Group;
               var groupedColumn = this.GetGroupedColumn(groupRecord);
    
               if (this.DataGrid.CaptionSummaryRow == null)
               {
    
                   if (this.DataGrid.View.GroupDescriptions.Count < groupRecord.Level)
                       return;
    
                   //Set the CaptionSummaryCell text as customized.
                   element.Content = GetCustomizedCaptionText(groupedColumn.HeaderText, groupRecord.Key, groupRecord.ItemsCount);
               }
    
               else if (this.DataGrid.CaptionSummaryRow.ShowSummaryInRow)
               {
                   element.Content = SummaryCreator.GetSummaryDisplayTextForRow(groupRecord.SummaryDetails, this.DataGrid.View, groupedColumn.HeaderText);
               }
    
               else
                  element.Content = SummaryCreator.GetSummaryDisplayText(groupRecord.SummaryDetails, dataColumn.GridColumn.MappingName, this.DataGrid.View);
           }
       }
    
       private GridColumn GetGroupedColumn(Group group)
       {
           var groupDesc = this.DataGrid.View.GroupDescriptions[group.Level - 1];
    
           foreach (var column in this.DataGrid.Columns)
           {
    
               if (column.MappingName == groupDesc.PropertyName)
               {
                  return column;
               }
           }
           return null;
       }
    
       private string GetCustomizedCaptionText(string columnName, object groupName, int itemsCount)
       {
    
           //entryText - instead of "Items", the entryText is assigned to Customize the CaptionSummaryCell Text.
           string entryText = string.Empty;
    
           if (itemsCount < 20)
               entryText = "entries in the Group";
    
           else if (itemsCount < 40)
               entryText = "elements in the Group";
    
           else if (itemsCount < 60)
               entryText = "list in the Group";
    
           else
               entryText = "items in the Group";
    
           if (groupName.ToString().Equals("1001"))
               groupName = "Thousand and One";
    
           else if (groupName.ToString().Equals("1002"))
               groupName = "Thousand and Two";
    
           else if (groupName.ToString().Equals("1004"))
               groupName = "Thousand and Four";
           return string.Format("{0}: {1} - {2} {3}", columnName, groupName, itemsCount, entryText);
       }
    }

    Constructors

    GridCaptionSummaryCellRenderer()

    Initializes a new Instance of GridCaptionSummaryCellRenderer class.

    Declaration
    public GridCaptionSummaryCellRenderer()

    Methods

    InitializeCellStyle(DataColumnBase, Object)

    Initializes the custom style for cell when the corresponding api's and selectors are used.

    Declaration
    protected override void InitializeCellStyle(DataColumnBase dataColumn, object record)
    Parameters
    Type Name Description
    DataColumnBase dataColumn

    Specifies the corresponding DataColumnBase.

    System.Object record

    Specifies the corresponding record to initialize cell style.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRendererBase<Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell, Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell>.InitializeCellStyle(Syncfusion.UI.Xaml.DataGrid.DataColumnBase, System.Object)

    OnInitializeEditElement(DataColumnBase, GridCaptionSummaryCell, Object)

    Initializes the binding editor for corresponding column.

    Declaration
    public override void OnInitializeEditElement(DataColumnBase dataColumn, GridCaptionSummaryCell uiElement, object dataContext)
    Parameters
    Type Name Description
    DataColumnBase dataColumn

    Specifies the corresponding DataColumnBase.

    GridCaptionSummaryCell uiElement

    Specifies the corresponding UIElement.

    System.Object dataContext

    Specifies the dataContext of the cell.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRenderer<Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell, Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell>.OnInitializeEditElement(Syncfusion.UI.Xaml.DataGrid.DataColumnBase, Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell, System.Object)

    OnUpdateEditBinding(DataColumnBase, GridCaptionSummaryCell, Object)

    Updates the binding for editor control of corresponding column.

    Declaration
    public override void OnUpdateEditBinding(DataColumnBase dataColumn, GridCaptionSummaryCell element, object dataContext)
    Parameters
    Type Name Description
    DataColumnBase dataColumn

    Specifies the corresponding DataColumnBase.

    GridCaptionSummaryCell element

    Specifies the corresponding GridCaptionSummaryCell.

    System.Object dataContext

    Specifies the data context of the cell.

    Overrides
    Syncfusion.UI.Xaml.DataGrid.Renderers.GridVirtualizingCellRenderer<Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell, Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell>.OnUpdateEditBinding(Syncfusion.UI.Xaml.DataGrid.DataColumnBase, Syncfusion.UI.Xaml.DataGrid.GridCaptionSummaryCell, System.Object)

    Implements

    IGridCellRenderer
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved