GridViewComboBoxColumn Ria DataBinding Silverlight 4

7 posts, 0 answers
  1. Christopher Chenoweth
    Christopher Chenoweth avatar
    4 posts
    Member since:
    Nov 2008

    Posted 21 Apr 2010 Link to this post

    Hello,

    I've done quite a bit of research and would like to get a definitive answer on this.

    I would like to simply bind a combo box in a radgrid that comes from a RIA Data Source.  I found someone who said to put the DomainDataSource into the Resources Section.  I was able to get their example to work with the regular combo box.  I would really like to use the Telerik version.

    I have phone numbers in a table that have a type.  The PhoneType table has some values such as Home, Work, Cell, etc.  The Phone Table has a PhoneTypeID field.

    The combobox should only show up on Edit and bind to the PhoneTypeID in the Phone Table.

    This person had the best information I found on this:
    http://msmvps.com/blogs/deborahk/archive/2009/11/25/silverlight-and-ria-adding-a-combobox-to-a-dataform.aspx

    Can someone give me a project example or an easy way to do this that I am missing.

    Thanks,
    Chris
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 23 Apr 2010 Link to this post

    Hello Christopher Chenoweth,

    The attached project has a RadGridView bound to the Orders table of Northwind and a ComboBoxColumn showing Customers .
    Both the RadGridView and the GridViewComboBox column are bound via DomainDataSource.

    Regards,
    Pavel Pavlov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 24 Apr 2010 Link to this post

    Hi

    Nice example..

    But what about if the combobox has to be binded with customerID and Filtered  with customer.country = Order.shipcountry  row??

    this is very common on a LOB when you don't want to show all the customers, You just want to show on the combobox the customers of the orders.shipcountry of the row.

    I'm trying to do that, but I don't see where to put the  customer.country = Order.shipcountry
     
    <telerik:GridViewComboBoxColumn ItemsSourceBinding="{Binding Data, Source={StaticResource ddsCustomers}}" DataMemberBinding="{Binding CustomerID}" DisplayMemberPath="ContactName" SelectedValueMemberPath="CustomerID" />


    I have post a recuest for a example here:

    http://www.telerik.com/community/forums/silverlight/gridview/can-you-add-this-to-the-demo.aspx


    Thank you
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 28 Apr 2010 Link to this post

    Hi JUAN CRESPO,

    Please find the sample attached.
    Here is the approach used:

    I have added a Customers property to the Order entity. This property contains a list of customers filtered by the ship country.
    This way in XAML I can bind the combobox column directly to this property like :

    <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding CustomerID}" DisplayMemberPath="ContactName" SelectedValueMemberPath="CustomerID" ItemsSourceBinding="{Binding Customers}" />

    For the purposes of the demo I populate this property at the client via a small helper class. In  a real project you may find more reasonable to create and populate the property at the server side.


    Greetings,
    Pavel Pavlov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 29 Apr 2010 Link to this post

    First.. THANK YOU VERY MUCH!!

    After checking sample I have some suggestions.

     

    1.- Don’t you think that you should add a easier way to implement this “feature”? Most of the LOB applications have this problem. There are dependencies between different comboboxes on a Grid (row or columns). There should be an easier way to do that. Maybe with a new property to filter the combo ?? In our application we are going to have this type of comboboxes on a grid on most of our grids (like 100).If you have to create a property on code this is going to be hard. Can you think about it? (note I have add a as suggestion on PITS 305234 )

     

    2.- Also if we create the EF model correctly and we have an Entity that has a relation(navigation) with another Entity and we define on the “Datasources window” that we want the column “ContryID” to be a RadGridViewcombo (right now there is only an option to set the RadCombobox but it does not work) and the Orders to be a RadGRID. We should be able to Drag&Drop the RadGrid to a Page and the RadGrid should be able to do all the bindings automatically and to place the GridViewComboBox . Do you think? (note I have add as a suggestion on PITS 305224 )


    3.- The idea is to avoid to use CODE... and have the most of the bindins and filters on  the XAML

    I think your RADGridView is very powerful!!!! But for common task it should be easier to implement LOB scenarios…

     

    Can you guys think about it??

     

    Thank you very much

     

  7. Jaan
    Jaan avatar
    1 posts
    Member since:
    Apr 2012

    Posted 24 May 2012 Link to this post

    Ignore this post, I managed to fix it. Seems, that the logic for changes was somewhere else.

    Jaan
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 24 May 2012 Link to this post

    Hi,

    Glad to know you have managed  to fix the issue. Any suggestions in this thread will be taken in concern for our very next planning.

    Kind regards,
    Pavel Pavlov
    the Telerik team

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

Back to Top
DevCraft banner