Expression editor to change the grid cell value or style

6 posts, 0 answers
  1. preeti
    preeti avatar
    36 posts
    Member since:
    Oct 2010

    Posted 20 Jul 2011 Link to this post

    Hi,

    Is it possible that depending on some expression the cell content can be changed.
    my requirement is like for example i have a Country column where if the Cell value is "US" then its content should be replaced by "United States" or the cells background and foreground colors, fonts etc should be changed to some value that i can define in expression editor.

    Is this possible?
  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 20 Jul 2011 Link to this post

    Hi Preeti,

     You can use RadGridvView's ConditionalStyleSelector (you can see it in action here). The Condition property of the StyleRule class is of type Expression, so you can directly use the expression built by a RadExpressionEditor.

    Greetings, Yavor Georgiev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. preeti
    preeti avatar
    36 posts
    Member since:
    Oct 2010

    Posted 27 Jul 2011 Link to this post

    My requirement is little different. i have this earlier developed project for which i have my expression editor. now since this telerik expression editor is strong and can handle multiple cases i would like my editor to be replaced with yours.

    is it possible to use it as a control which would just evaluate the condition for cell values of noraml silverlight grid instead of telerik grid and give me true or false depending on the result of the expression? and is there any way to provide it with input values of grid columns.

    i am also unable to find the Expression editor control in telerik .windows.controls i am useing version 2011.2.712.1040.
  5. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 27 Jul 2011 Link to this post

    Hi Preeti,

     I'm afraid RadExpressionEditor does not provide such functionality out of the box. However, you can download the source code of the control from your account and modify it to suit your needs.

     You can also use the new TryParse extension method to parse a string expression programmatically, which you can then compile to a delegate and invoke manually.

     RadExpressionEditor is contained in the Telerik.Windows.Controls.Expressions assembly, in the Telerik.Windows.Controls namespace. Please make sure you have the right references and namespace imports, as outlined in our documentation.

    All the best, Yavor Georgiev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. preeti
    preeti avatar
    36 posts
    Member since:
    Oct 2010

    Posted 02 Aug 2011 Link to this post

    I am a liscenced user form where can i download the source code?
  7. Hristo
    Admin
    Hristo avatar
    408 posts

    Posted 02 Aug 2011 Link to this post

    Hello Preeti,

    You can download the source code from here.

    Kind regards,
    Hristo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top
DevCraft banner