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 7860483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:18:24+00:00 2026-06-02T22:18:24+00:00

Given a usercontrol bound to a viewmodel defined as follows class MyViewModel { public

  • 0

Given a usercontrol bound to a viewmodel defined as follows

class MyViewModel
{
    public DataView MyView { get; set; }
    public DataView MyTypes { get; set; }
}

and the XAML is roughly marked as follows

<Grid>
    <dxg:GridControl AutoPopulateColumns="True" Name="gridControl1" ItemsSource="{ Binding MyView}">
        <dxg:GridControl.Columns>
            <dxg:GridColumn FieldName="col1">
                <dxg:GridColumn.EditTemplate>
                    <ControlTemplate>
                        <dxe:ComboBoxEdit Name="cmbTypes" 
                       ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},
                            Path=ViewModel.MyTypes}"/>
                    </ControlTemplate>
                </dxg:GridColumn.EditTemplate>
            </dxg:GridColumn>
            <dxg:GridColumn FieldName="col2"/>
            <dxg:GridColumn FieldName="col3" Width="75"/>
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
            <dxg:TableView Name="tableView1" AutoWidth="True" ShowTotalSummary="True" />
        </dxg:GridControl.View>
    </dxg:GridControl>
</Grid>

bound as follows

internal MyViewModel ViewModel
{
    get { return (MyViewModel)DataContext; }
    set { DataContext = value; }
}

Of course the ComboBox does not show the selections from ListTypes which does have values

Question is – how to reference the ListTypes property of the ViewModel
from Grid.Column where the Grid is Bound to a DataView MyItems which does not have the property ListTypes, which is at the same level as ListTypes !!!

Any help is appreciated

  • 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-06-02T22:18:28+00:00Added an answer on June 2, 2026 at 10:18 pm

    If I’ve understood the question correctly, I’d expect the following to work:

    {Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}},
                            Path=DataContext.MyTypes}
    

    It may be that Path=ViewModel.MyTypes is not working simply because you haven’t implemented change notification on the ViewModel property. As I say, though – you should be able to get along fine with Path=DataContext.MyTypes.

    Note: you seem to refer to the property as both MyTypes and ListTypes in the question – not sure which is correct for your object model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I defined a usercontrol: <s:SurfaceUserControl x:Class=Prototype_Concept_1.CodeBox xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:s=http://schemas.microsoft.com/surface/2008> <Grid> <Viewbox> <s:SurfaceScrollViewer Margin=10,10,10,10 x:Name=scroll
I have a code: public class Layout : UserControl { protected void DisplayX_DisplayClicked(object sender,
I like to create a UserControl with own Header Property. public partial class SomeClass:
Given a Python object of any kind, is there an easy way to get
Given the following XAML: <TabControl DataContext={StaticResource mainVM} ItemsSource={Binding MovableVM.Docked, UpdateSourceTrigger=PropertyChanged}> <TabControl.ItemTemplate> <DataTemplate> <TextBlock> <TextBlock
Given the following insane setup (a ComboBox inside a UserControl inside a ToolStripControlHost inside
Given the following code why would My Stupid Text never be bound to the
given the following XAML code: <Canvas Name=MainView> <Canvas Name=TriangleElement Width=50 Height=50 Canvas.Left=110 Canvas.Top=100> <Canvas.RenderTransform>
I built a UserControl with a dependency property like this: public MyUserContol() { InitializeComponent();
Given the following XAML code that with a ListControl like behavior: <StackPanel> <ItemsControl Name=_listbox

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.