Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
Databinding TemplateColumn EditorTemplate
posted

I have the following object: Row contains cell objects.  The cell object is accessed through a property.  Lets use the property Cell1 for this example.  The binding works fine when my grid is not in edit mode.  When I place the grid in editmode the cell level datacontext is ignored and my editor template data gets the grids itemsource as its datacontext.  I am explicitly binding my datatemplate controls data context to the cell property from my itemsource

<ig:XamGrid ItemsSource="{Binding Rows}"

My ItemTemplate would like this for example

<TextBlock Text="{Binding Col1.DisplayName}" />

My EditorTemplate Binding looks like this

<uc:MyUserControl DataContext="{Binding Col1}"

my usercontrol is being passed rows as the datacontext.

The item template's value is set accordingly.  When I debug my binding on the usercontrol it is not getting Col1 as its datacontext it is getting the itemssource of my xamgrid for the datacontext

 

Thanks for you help

 

Will