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
1140
TemplateColumn Editor Template ComboBox
posted

<p>I am attempting to use the following template for a column, the combobox is filled correctly when not embedded into the datagrid, and not bound at all when added to the editor template.<br /></p>

<p>
<ComboBox ItemsSource="{Binding AbsCodes, ElementName=userControl, Mode=OneWay}" DisplayMemberPath="AbsCode">
<ComboBox.DataContext>
<HQPORTAL_HRPoints:AbsCodeRefContract/>
</ComboBox.DataContext>
</ComboBox></p>

Parents
  • 40030
    Offline posted

    Hi, 

    So, i believe in a TemplateColumn the DataContext of the element in the Template is set when its loaded, as it led to the best performance with virtualization.  I can look into other ways of doing this, but for now, can you try wrapping your ComboBox in another element in the DataTemplate?

    <DataTemplate>

         <Border><ComboBox /> </Border

    </DataTemplate>

    -SteveZ

Reply Children