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
1070
CellValuePresenter Button with Command
posted

I have a style that puts a button in an UnboundField of a row. The button calls the MyCommand method on MyClass. Everything works fine, except the Parameter to the event handler is null. I'd like to have the button do an expand all on all the child records, so I was hoping to get to the record that contains the CellValuePresenter, which is why I'm passng Record as the parameter.

Why is the record field null? What should I bind to so that I can iterate and expand child records of the buttons row?

                <Style x:Key="myStyle" TargetType="{x:Type igDP:CellValuePresenter}" BasedOn="{x:Static igThemes:DataPresenterGeneric.CellValuePresenter}">

                    <Setter Property="Template">

                        <Setter.Value>

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

                                <Button Content="+" HorizontalAlignment="Center" VerticalAlignment="Center"

                                        Command="local:MyClass.MyCommand"

                                        CommandParameter="{Binding Path=Record}"

                                        />

                            </ControlTemplate>

                        </Setter.Value>

                    </Setter>

                </Style>

Parents Reply Children
No Data