Derived Fields

2 posts, 0 answers
  1. Sathish
    Sathish avatar
    25 posts
    Member since:
    Dec 2008

    Posted 03 Mar 2009 Link to this post

    Hi,

    How do I add a derived field to a class. For example, I have a ClientShippingAddress table, with id, name, address, city, state, country etc.

    I'm going to allow the user to select one using radcombobox, so I need to display the text in this format ("Name, address, city, state, country")

    How do I bind this way to radcombobox? Since radcombobox takes only the field name, I thought of deriving it from the OQL query, or manually add a property to the class to retrieve this. If add it to the class, then if I recreate the persistent classes then it may be destroyed.

    Out of topic question: when is the next release scheduled? On your website it says beginning this month, do you have the exact date?
  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 05 Mar 2009 Link to this post

    Hi Sathish,
    you can display multiple items in your rad combo box by retrieving them with LINQ and creating anonymous class. Here is an example of how you can implement this using the Order table from Northwind.
    var result = from c in scope.Extent<OpenAccessData.Order>() select new { MyOrderDate = c.OrderDate, MyOrderID= c.OrderID }; 
                    RadComboBox1.DataSource = result; 
                    RadComboBox1.DataBind(); 
    In the select new{} you can select all the fields that you need thus filtering those that are unneeded.
    As for your second question our release is targeted at 10th of March.

    Regards,
    PetarP
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
Back to Top