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
1095
XamWebGrid 2009.2 - Enabling Default summary in code
posted

Hi,

Im trying to make the new feature with summary lines work in my app and im running into some trouble.

Im adding my columns in the ColumnLayoutAssigned event. Here i do something similar to this :

------------

 ColumnLayout cl = new ColumnLayout();

TextColumn tc1 = new TextColumn()
{
   Key = "Counter",
   IsSummable = true
};

SumSummaryOperand sso = new SumSummaryOperand();
sso.IsApplied = true;
tc1.SummaryColumnSettings.SummaryOperands.Add(sso);

cl.Columns.Add(tc1);

e.ColumnLayout = cl;

----------

The xamwebgrid is bound to an observablecollection of some objects containing a "Counter" column.

Ive tested that if i add a column in xaml and turn on Sum there with the IsApplied flag it works fine. However when doing it like i have to in code in my ColumnLayoutAssigned event, the Sum function is not turned on by default when the grid is loaded.

Am i doing something wrong ?

I can post an mockup app if needed.

regards

Øyvind

Parents
No Data
Reply
  • 21382
    posted

    I am not able to reproduce your results, but one thing you could try is adding the column to the grid prior to adding the SummaryOperand to the collection. 

     

    If you have a sample, I will gladly look at it to determine what is going on.

Children