This question is locked. New answers and comments are not allowed.
Hello,
i have a very simple question. I have a datagridview in silverlight with two databound columns. How do i create a third column that has the calculated value of column1 + column2.
kind regards,
Jonam
i have a very simple question. I have a datagridview in silverlight with two databound columns. How do i create a third column that has the calculated value of column1 + column2.
kind regards,
Jonam
8 Answers, 1 is accepted
0
Accepted
Hi Jonam,
Vanya Pavlova
the Telerik team
Please see the following here.
Greetings,Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jonam
Top achievements
Rank 1
answered on 15 Aug 2010, 05:38 PM
Hello,
thank you for the example. This providers a solution by declaring it in XAML. Can it also be done in code (c#)?
kind regards,
Jonam
thank you for the example. This providers a solution by declaring it in XAML. Can it also be done in code (c#)?
kind regards,
Jonam
0
Hello Jonam,
You can find more information about defining columns in our online documentation.
Greetings,
Maya
the Telerik team
There is no problem to define the calculated column in the code-behind. Thus following the example, that column would be like:
GridViewDataColumn calculatedColumn = new GridViewDataColumn();calculatedColumn.TextAlignment = System.Windows.TextAlignment.Right;calculatedColumn.DataMemberBinding = new Binding("Total"); this.gridView.Columns.Add(calculatedColumn);You can find more information about defining columns in our online documentation.
Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jonam
Top achievements
Rank 1
answered on 16 Aug 2010, 02:13 PM
Hello maya,
thank you for replying. In the online documentation you can find how to create columns with bindings to a value of an object but now how to bind to a calculated column. Do you know how this is possible?
kind regards,
Jonam
thank you for replying. In the online documentation you can find how to create columns with bindings to a value of an object but now how to bind to a calculated column. Do you know how this is possible?
kind regards,
Jonam
0
Hello Jonam,
Maya
the Telerik team
Please give us more specifics about your project. What is the purpose of binging to a column? Do you expect to get its values?
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jonam
Top achievements
Rank 1
answered on 17 Aug 2010, 07:33 AM
Hello Maya,
What i want in my project specified above and an answer is already given. I want column A to be a total of column B + C. The solution above works fine but i want to create the column dynamic in the code behind and not in the XAML. Do think this is possible?
kind regards,
Jonam
What i want in my project specified above and an answer is already given. I want column A to be a total of column B + C. The solution above works fine but i want to create the column dynamic in the code behind and not in the XAML. Do think this is possible?
kind regards,
Jonam
0
Accepted
Hello Jonam,
Maya
the Telerik team
I have prepared a sample project illustrating how to add the "Total" column dynamically on a Button-Click.
I hope that meets your requirements.
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jonam
Top achievements
Rank 1
answered on 19 Aug 2010, 11:43 AM
Thanks Maya that was great!