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
DataGrid Button Cell - Conditional visibility
posted

Hi Folks,

I have a Datagrid with a csutom columns that has a button as a content. The button is visible for all rows. What I would like to do is to make the button invisible and set IsEnabled to false if an underlying ViewModel for this row is of certain type. I do have a converter ready, but don't know how to connect it to the FieldSetting. Is my approach completely worong here? If so how to set thi up?

Thanks!

<igDP:UnboundField >
                            <igDP:UnboundField.Settings>
                                <igDP:FieldSettings>
                                    <igDP:FieldSettings.CellValuePresenterStyle>
                                        <Style TargetType="{x:Type igDP:CellValuePresenter}">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate>
                                                        <Button Content="Command" Command="{Binding ShowPressureLossWindow}" Margin="3"/>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </igDP:FieldSettings.CellValuePresenterStyle>
                                </igDP:FieldSettings>
                            </igDP:UnboundField.Settings>
                        </igDP:UnboundField>