Define list of Fields programmatically at runtime

8 posts, 1 answers
  1. Sergio
    Sergio avatar
    14 posts
    Member since:
    Jun 2010

    Posted 21 Apr 2013 Link to this post

    Hi,

    I'm trying to use ExpressionEditor (Silverlight) to build in my application a screen that allows users to define Where clauses to be used in the database.
    For that, the list of Fields available in the ExpressionEditor control should have the list of database columns that can be used in the Where clause. Because this list can change (for example, based on the table being used), the ideal solution for me is to send those columns from the database. Is it possible to change, at runtime, the Fields that can be used in ExpressionEditor?

    Thanks,
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Apr 2013 Link to this post

    Hi,

     
    RadExpressionEditor has a property called Item. This Item is the context against which the expression is evaluated and the result is calculated. The list of available fields is automatically populated by based on the properties that the object assigned to Item has. So in order to change the list of available fields, you need to assign an object to RadExpressionEditor.Item and the list of fields will be based on the properties that this object has. You can't simply assign random fields names to the list of available fields.

    All the best,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Sergio
    Sergio avatar
    14 posts
    Member since:
    Jun 2010

    Posted 22 Apr 2013 Link to this post

    Hi,

    If I need to bind an object to the Item property so RadExpressionEditor can understand the Fields that are available, can I bind it to an object that implements ICustomTypeProvider interface? That way, I can at runtime extend my object to have the additional properties I need.

    Best regards,
  5. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 22 Apr 2013 Link to this post

    Hi,

     
    Yes, we have recently added support for ICustomTypeProvider and we will scan its properties and show them in the fields list. You may need to rebind the Item after you change some properties so that the editor can refresh.

    Greetings,
    Rossen Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Jorge
    Jorge avatar
    5 posts
    Member since:
    May 2012

    Posted 04 Jun 2013 Link to this post

    please a reference of that ... or link
    thk. a lot.
  7. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 05 Jun 2013 Link to this post

    Hello,

    What kind of link do you need? Tiago asked a question and we answered him, so we are not really sure what kind of reference you are having in mind.

    Regards,
    Rossen Hristov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Jorge
    Jorge avatar
    5 posts
    Member since:
    May 2012

    Posted 10 Jun 2013 Link to this post

    i need more info about:
    i have a object list, and now i need to use that objects like fields. but.. i dont understand how bind the name of my object property to the name of field, may the was so.. useful work all in object type..or i need to create a template for the item .. please  enlighten me thk.. :D
  9. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 11 Jun 2013 Link to this post

    Hi,

    I am afraid that based on this description of the issue, I really could not understand anything from your question. 

    Could you please open a new support ticket, prepare a runnable sample project that clearly demonstrates the problem that you are facing and explain in great detail what exactly are you trying to achieve and what the exact problem is which is preventing you from achieving it.

    This will be the fastest way to resolve your issue.

    Thank you.

    Regards,
    Rossen Hristov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner