Skip to content

Instantly share code, notes, and snippets.

@yavor87
Last active August 29, 2018 18:36
Show Gist options
  • Save yavor87/c8b9cc037eb646447a1c459d38bcce81 to your computer and use it in GitHub Desktop.
Save yavor87/c8b9cc037eb646447a1c459d38bcce81 to your computer and use it in GitHub Desktop.
<Application>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Data.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Input.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
public class Employee
{
[Display(AutoGenerateField = false)]
public string FirstName { get; set; }
[Display(AutoGenerateField = false)]
public string LastName { get; set; }
[Display(AutoGenerateField = false)]
public decimal Salary { get; set; }
[Display(Order = 2)]
public string Department { get; set; }
[Display(Name = "Name", Order = 1)]
public string FullName => $"{FirstName} {LastName}";
[Display(Name = "Salary", Order = 3)]
public string FormattedSalary => this.Salary.ToString("C");
}
<telerik:RadDataPager Grid.Row="1" Source="{Binding Items, ElementName=grid}" PageSize="5" DisplayMode="Next,Previous,Numeric,Text" />
<telerik:RadGridView ItemsSource="{x:Static local:SampleData.Employees}"
AutoGenerateColumns="False" ShowColumnFooters="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding FullName}" Header="Name" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Department}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Salary, StringFormat={}{0:C}}">
<telerik:GridViewDataColumn.AggregateFunctions>
<telerik:MinFunction Caption="Min: " ResultFormatString="{}{0:C0}" />
<telerik:AverageFunction Caption="Avg: " ResultFormatString="{}{0:C0}" />
<telerik:MaxFunction Caption="Max: " ResultFormatString="{}{0:C0}" />
</telerik:GridViewDataColumn.AggregateFunctions>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment