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
460
Hide Summery text from summary fields programmatically
posted

Hi 

How can I hide the Sum text from Summary field programmatically so it is only the summary result that is shown

Parents
No Data
Reply
  • 2680
    Offline posted

    Hello Thomas,

    I have been looking into your question and created a small sample with a XamDataGrid where only the sum summary result is shown for a summary field.

    In order to achieve this programmatically, my suggestion is to format the summary value in the grid’s FieldLayoutInitialized event:

     private void xdg_FieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e)
            {
                SummaryDefinition summary = new SummaryDefinition();
                summary.Calculator = SummaryCalculator.Sum;
                summary.SourceFieldName = "Number1";
                summary.Key = "Field1.1";
                summary.StringFormat = "{0:N0}";
                this.xdg.FieldLayouts[0].SummaryDefinitions.Add(summary);
            }

    Additionally, you could check out this topic in our documentation regarding formatting the value of a Summary.

    You can find the sample attached below. If you require any further assistance on the matter, please let me know.

    Sincerely,

    Bozhidara Pachilova

    Associate Software Developer

    4452.XDGSummaryStringFormat.zip

Children
No Data