FlexGrid for WinRT
GroupHeaderConverter Property
Example 

Gets or sets the Windows.UI.Xaml.Data.IValueConverter used to create the content shown in GroupRow cells to summarize group information.
Syntax
'Declaration
 
Public Property GroupHeaderConverter As Windows.UI.Xaml.Data.IValueConverter
public Windows.UI.Xaml.Data.IValueConverter GroupHeaderConverter {get; set;}
Remarks

By default, the grid creates group headers that show the name of the property being grouped on, the value of the property, and the number of items in the group.

You can modify or customize this information by defining your own group header converter class and assigning an instance of this class to the grid's GroupHeaderConverter property.

Example
The example below shows the default group header converter class implementation.
class GroupHeaderConverter : IValueConverter
{
  public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  {
    var gr = parameter as GroupRow;
    var group = gr.Group;
    if (group != null && gr != null && targetType == typeof(string))
    {
      var desc = gr.Grid.CollectionView.GroupDescriptions[gr.Level] as PropertyGroupDescription;
      return desc != null
        ? string.Format("{0}: {1} ({2:n0} item{3})", 
            desc.PropertyName, 
            group.Name, 
            group.ItemCount, 
            group.ItemCount == 1 ? string.Empty : "s")
        : string.Format("{0} ({1:n0} items)", group.Name, group.ItemCount);
    }
      
    // default
    return value;
  }
  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  {
    return value;
  }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

C1FlexGrid Class
C1FlexGrid Members

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum  |   Documentation Feedback