Combobox complex databinding

2 posts, 0 answers
  1. Tarik
    Tarik avatar
    12 posts
    Member since:
    May 2015

    Posted 05 Jun 2015 Link to this post

    Hello, i would like to bind a combobox to a list like bellow, and in the combobox i would like to use Designation which is a property of Regulation property of my DTO as a display memberpath, and RegulationId as a SelectedValuePath, wich is a Regulation property Too

    List<RegulationDto> list = MyWebService.GetList();

    Here the DTO:

    public class RegulationDto{
            public Regulation regulation;
            public List<ExceptionRegulation> regulationExceptions;
            public List<PointPassageDTO> pointsPassages;
    }

  2. Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 10 Jun 2015 Link to this post

    Hello Tarik,

    Please, check the following code - snippet that demonstrates how to achieve the desired:
    <telerik:RadComboBox Width="200" x:Name="radComboBox" ItemsSource="{Binding list}" DisplayMemberPath="regulation.Designation " SelectedValuePath="regulation.RegulationId "/>

    We hope this will help you.

    Regards,
    Nasko
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top