This is a migrated thread and some comments may be shown as answers.
GridCalculatedColumn Expression Cast. Issue.
2 Answers 11 Views
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 30 Jun 2016, 03:37 PM

Hi,
I have a simple problem with a GridCalculatedColumn where i want to display the concatenation of a string and a int .
I dont have to filter or anything on it. I just need so text before the int value.

<telerik:GridCalculatedColumn UniqueName="c1" DataFields="myString, myInt"  DataType="System.String" Expression="{0}{1}"></telerik:GridCalculatedColumn>

myString And myInt are from a linq data source.
 I have try the : Expression="{0}Convert({1},'System.String')"

 

If you have any idea on how to do that without having to use databinding event or a Template Item.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 05 Jul 2016, 11:59 AM
Hello Pierre,

If you need to just concatenate two values, maybe the GridCalculatedColumn is not the best solution, although that you should be able to use the following expression for displaying the values:
Expression="{0} + Object({1})"

If no calculations will be made, I would recommend the GridTemplateColumn, where you can define the ItemTemplate as per your requirements:
Hope this helps.


Regards,
Konstantin Dikov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Pierre
Top achievements
Rank 1
answered on 06 Jul 2016, 06:22 AM
Thank you ! Im already using a Template column for this after my fail with the concatenate.
Tags
Grid
Asked by
Pierre
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Pierre
Top achievements
Rank 1
Share this question
or