GridCalculatedColumn Expression Cast. Issue.

3 posts, 1 answers
  1. Pierre
    Pierre avatar
    52 posts
    Member since:
    Jun 2016

    Posted 30 Jun Link to this post

    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. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    1744 posts

    Posted 05 Jul Link to this post

    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.

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Pierre
    Pierre avatar
    52 posts
    Member since:
    Jun 2016

    Posted 06 Jul Link to this post

    Thank you ! Im already using a Template column for this after my fail with the concatenate.
Back to Top