This is a migrated thread and some comments may be shown as answers.

[Solved] Define list of Fields programmatically at runtime

7 Answers 226 Views
ExpressionEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sergio
Top achievements
Rank 1
Sergio asked on 21 Apr 2013, 09:19 AM
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,

7 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 22 Apr 2013, 08:22 AM
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.

0
Sergio
Top achievements
Rank 1
answered on 22 Apr 2013, 06:50 PM
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,
0
Accepted
Rossen Hristov
Telerik team
answered on 23 Apr 2013, 04:12 AM
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.

0
Jorge
Top achievements
Rank 1
answered on 04 Jun 2013, 08:30 PM
please a reference of that ... or link
thk. a lot.
0
Rossen Hristov
Telerik team
answered on 05 Jun 2013, 06:13 AM
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.

0
Jorge
Top achievements
Rank 1
answered on 11 Jun 2013, 12:45 AM
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
0
Rossen Hristov
Telerik team
answered on 11 Jun 2013, 07:20 AM
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.

Tags
ExpressionEditor
Asked by
Sergio
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Sergio
Top achievements
Rank 1
Jorge
Top achievements
Rank 1
Share this question
or