I would like to have a seperate textbox, right next to the grid, to display the aggregate result from the grid. To calculate the aggregate result from one of the columns from my grid, I have this
Column.Expression = ColumnExpression;
var totalAggregate = new AggregateFunction<GridColumns, double>
{
AggregationExpression = adjustedColumns => adjustedColumns.Sum(a*b)
Caption = " Total: "
};
ColumnExpression.AggregateFunctions.Add(totalAggregate);And for my textbox, I have this:
Binding binding = new Binding("TotalAggregate");
binding.Source = adjustedTotalAggregate.ToString();
binding.Mode = BindingMode.OneWay;
textBox1.SetBinding(TextBox.TextProperty, binding);
Although it doesn't give me any error, but the result from my aggregate result doesn't showes up in the textbox. I wonder how this is usually done. Thank you very much
10 Answers, 1 is accepted
Please check this forum thread for an example on how this could be done.
All the best,Didie
the Telerik team
I have one more questions, how can I pass that same value from one tab to another tab? Let's say that I have the grid sits in tab1, and I would like to by pass the aggregate result to a textbox sits in tab2? How can I do it? Thanks
Unfortunately you cannot bind to a value that is in a different tab. I would recommend you to work directly with your underlying data, rather then with the values calculated by the GridView.
Regards,Didie
the Telerik team
Unfortunately I cannot suggest such a workaround.
Greetings,Didie
the Telerik team
Indeed, this would be good. That way you can populate the saved values as desired.
Regards,Didie
the Telerik team
You can review the source code of this online demo for an example. Please especially note how the document to be printed is created.
All the best,Didie
the Telerik team