By default the Sum or Average displays ex. Sum = 23456788.
I would like to format it as Sum = 23,456,788
Also in a Date field, it displays ex. Max = 2/3/2010 12:00:00:00 AM.
Can i set it to show only date (no time)?
Thank you.
Hi,This snippet sets a format string for the Sum operand on a TextColumn containing double data:<ig:TextColumn Key="DoubleData"> <ig:TextColumn.SummaryColumnSettings> <ig:SummaryColumnSettings> <ig:SummaryColumnSettings.SummaryOperands> <ig:SumSummaryOperand FormatString="{}{0:#.#%}" /> </ig:SummaryColumnSettings.SummaryOperands> </ig:SummaryColumnSettings> </ig:TextColumn.SummaryColumnSettings></ig:TextColumn>
You can use a similar syntax to fromat the date of the max operand on a DateColumn.
Hope this helps.
Sorry I forgot to explain that there's no column listed in the XAML page.
I set the grid ItemSource to the list collection and control the column display format in ColumnLayoutAssigned event.
Amy
Hi Amy,
Similarirly, you could do it in code-behind by placing whenever you decide code similar to the following sample:
void MainPage_Loaded(object sender, RoutedEventArgs e) { this.TestXamWebGrid.ItemsSource = new ObservableCollection<TestData>() { new TestData() { DateTimeData = DateTime.MinValue }, new TestData() { DateTimeData = DateTime.Now }, new TestData() { DateTimeData = DateTime.Now }, new TestData() { DateTimeData = DateTime.Now }, new TestData() { DateTimeData = DateTime.MaxValue } };
MaximumSummaryOperand operand = new MaximumSummaryOperand();
operand.FormatString = "{0:dd/MM/yyyy}"; operand.IsApplied = true;
this.TestXamWebGrid.Columns.DataColumns["DateTimeData"].SummaryColumnSettings.SummaryOperands.Add(operand); }
HTH,