Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:52:52+00:00 2026-05-30T04:52:52+00:00

I have difficulties in binding the follow structures to XAML View: public class SampleViewModel

  • 0

I have difficulties in binding the follow structures to XAML View:

public class SampleViewModel : ViewModelBase
{
   public ObservableCollection<ChildViewModel> Child { get; set; }
   ...
   public ObservableCollection<Country> Countries { get; set; }
   ...
}
public class ChildViewModel : ViewModelBase
{
   private int _CountryId;
   public int CountryId
   {
      get { return _CountryId; }
      set
      {
         _CountryId = value;
         OnPropertyChanged("CountryId");
      }
   }
   ...
}
// Country structure is not shown, just an int and string for CountryID 
// and Name in this case

Instance of SampleViewModel is set as DataContext of a View. I bind the collection Child to a GridView ItemsSource. In the GridView I have a ComboBox for Country and I want to populate it with Countries collection in the SampleViewModel.

<Telerik:RadGridView ItemsSource="{ Binding Child }" ...>
   <Telerik:RadGridView.Columns>
      <Telerik:GridViewComboBoxColumn DataMemberBinding="{Binding CountryId}"
                                      SelectedValueMemberPath="Id"
                                      DisplayMemberPath="Name"
                                      ItemsSource="{Binding ????}" />
      ...
   ...
...

What should be the ItemsSource ? How can I go back to root VM’s properties inside a ItemsSource=”{ Binding Child }” ?

Or how should I restructure the ViewModel to achieve the above ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:52:53+00:00Added an answer on May 30, 2026 at 4:52 am

    I am not sure how if this works with the Telerik controls, but usually you declare the binding via the RelativeSource attached property:

    {Binding Path=DataContext.Countries, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Telerik:RadGridView}}}
    

    Another way is to set a name on your RadGridView and use that as ElementName:

    <Telerik:RadGridView ItemsSource="{ Binding Child }" x:Name="gridView">
    ...
          <Telerik:GridViewComboBoxColumn DataMemberBinding="{Binding CountryId}"
                                          SelectedValueMemberPath="Id"
                                          DisplayMemberPath="Name"
                                          ItemsSource="{Binding DataContext.Countries, ElementName=gridView}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some difficulties with Ajax.BeginForm I have something like this in a view
could someone explain the code in catch_exceptions? i have difficulties to understand. thanks class
I have some difficulties in finding the directory in which a given class lies.
I have difficulties with using the this keyword in a MooTools (1.3) class. The
I have difficulties understanding a problem I encountered during instantiation of a QT class
I sometimes have difficulties with other people who wish to solve a problem when
I am reading the book: Intel Threading Building Blocks. I often have difficulties understanding
I have some difficulties in my project. I got the RGB values from a
I have some difficulties for using Ruby block, passing in a method. As in
I am having difficulties how to construct my question, but if I have to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.