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
765
Combobox in hierarchical datagrids column header
posted

Hi,

I want to add a combobox to an internal column header in a  hierarchical datagrid which has to be bound to a variable in the view model. How can I do this?

I've modified the LabelPresenter as follows.

 

<Style x:Key="HeaderStyle" TargetType="{x:Type igDP:LabelPresenter}" >

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="{x:Type igDP:LabelPresenter}">

                            <ComboBox>

                                <ComboBoxItem IsSelected="True">Weight</ComboBoxItem>

                                <ComboBoxItem>NOSH</ComboBoxItem>

                            </ComboBox>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

I have to be able to bind this to different instances. One for each set of child rows...

 

  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I suggest you set the ComboBox’s ItemsSource Property to your DataContext’s collection and the DisplayMemberPath Property to the value that you want to be displayed. Also the Style should be set to the Field’s FieldSettings’s LabelPresenterStyle that you want to have a ComboBox.

     

    Feel free to write me if you have further questions.

     

     

     

  • 765
    posted

    Can someone reply to this?