FlexSheet for WPF provides various options to display numbers in different number formats wherein you have the following categories to choose from:
By default, General category is selected in C1FlexSheet. General category does not have any special rule of formatting. You can change the number formatting of the cells to number, decimal, currency, percentage or scientific format. For example, to create a worksheet for your monthly or yearly business budgets, you can show the monetary values in Currency number format.
To format numbers in your C1FlexSheet worksheet, follow the steps given below:
XAML |
Copy Code
|
---|---|
<ComboBox x:Name="formatList" ItemsSource="{Binding NumberFormats}" Width="80" DisplayMemberPath="Name" Height="25" SelectedValue="{Binding SelectedFormat, Mode=TwoWay}" SelectionChanged="formatList_SelectionChanged"></ComboBox> <c1:C1NumericBox x:Name="decimalPlacesBox" Minimum="0" Margin="10,0,0,0" ValueChanged="decimalPlacesBox_ValueChanged"></c1:C1NumericBox> <Button x:Name="numberButton" Content="Apply" Click="numberButton_Click" Margin="20,10,0,0"></Button> |
Also, add the following code in Code view to set the NumberFormats property of ObservableCollection data collection of Number type: