Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
Suppressing Summary Label
posted

Hello,

I have a situation where my XamDataGrid objects need to be created dynamically.  I'm trying to create a summary definition in code where I want the summary label suppressed (i.e. "234" instead of "Sum = 234").

In XAML, I can accomplish this with a string format of "{}{0:n0}", but my string formats don't seem to have any effect when I move them to code.

For instance, In the FieldLayoutInitialized event handler, I have the code shown below.  When the XamDataGrid is displayed, my string format displays as "Sum = 234".  Any ideas of how to force my code string format?

Thanks,

Steve

private void XamDataGridOnFieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e)
{
    XamDataGrid xamDataGrid = (sender as XamDataGrid);
    SummaryDefinition summaryDef = new SummaryDefinition()
    {
        Key = string.Format("CountItems"),
        SourceFieldName = "Item",
        StringFormat = "{}{0:n0}"
    };
    xamDataGrid.DefaultFieldLayout.SummaryDefinitions.Add(summaryDef);
}

Parents
No Data
Reply Children