Expression Editor not accepting space in the item list

4 posts, 0 answers
  1. Shiva
    Shiva avatar
    61 posts
    Member since:
    Oct 2010

    Posted 23 Aug 2011 Link to this post

    Dear Community,

    We have bind the Item property of Telerik Expression Editor with a list we have on our page. The columns of this list are:
    • First Name
    • Last Name
    • Contact
    • Age

    And these items are visible on the Fields node of tree view perfectly fine.

    However, we have made an observation that while evaluating the expression, the editor shows a red color line beneath the items having a space. For example I have an expression like First Name + Last Name. Although both these items are legitimate items and editor must evaluate this expression and must consider this expression as valid, editor considers this expression INVALID.If I try to use items not having any space character in betweem it works all fine.

    Is there anything wrong with the items having space in it. How can we solve this issue as we have lot of items with space in between.

    Please suggest.

    Regards,
    Shiva

  2. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 23 Aug 2011 Link to this post

    Hi Shiva,

    Can you please send us a simple example project that illustrate how you define those properties with spaces in their name? Thanks in advance.

    Regards,
    Stefan Dobrev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Shiva
    Shiva avatar
    61 posts
    Member since:
    Oct 2010

    Posted 25 Aug 2011 Link to this post

    Dear Stefen,

    Actually we are kind of pivoting the list which we obtained from database. The list I mentioned in my post were actually rows of my result set. We then managed to convert these rows into a set of columns i.e. we created a new dynamic class and created its columns with these rows obtained from initial result set.

    We found a work around of using square brackets i.e [] around the items having space in between so that editor could sucessfully validate the expression. But we do not want user to put square brackets everytime. We want editor to automatically put [] around items with space in between.

    Is there a way or an event exposed in editor where in I can capture the item selected from the Items tree view node of the editor? If this is possible, then I'll check presence of space character in that item and will update its content to have square brackets around it.

    Please share your comments. Feel free to share any other/better solution if it suits our requirement. I request you to share the sample code snippet as well with your reply.

    Regards,
    Shiva
  5. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 26 Aug 2011 Link to this post

    Hi Shiva,

    Actually what you have found is the supported way to escape the spaces in a Field's name. We also support the ` (back quote) character as well. You can escape the [ (open bracket) or ] (open bracket) chars with \ (backslash) and escape the `(back quote) with `(back quote) as well. Our documentation is missing those details and I will make sure that we have this properly documented for out next official release.

    Regarding your actual problem this is definitely a bug in the expression editor. We should put brackets when we detect that the field name contains a whitespace character. I have logged this in our bug tracking system and we will provide a fix in one of our next latest internal builds.

    Thanks for your valuable feedback. It is greatly appreciated and I have updated your telerik points for that matter.

    Greetings,
    Stefan Dobrev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top