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
50
Enable/Disable Cells
posted

Hi,

         In a xamdatagrid, is it possible to disable a particual cell based on the value selected in another cell which is prior to that.

For e..g.,

Say we have a grid with Name and Age as columns, wherein Name Field is like popup listing giving employee names. After the selection of employee name, age automatically fills in and that particular cell got to be disabled.

Could you please tell me how this could be achieved?

Thanks,

Balaj Rajendran (WK - CCH, Torrance)

Parents
  • 69686
    Suggested Answer
    posted

    Hello Balaj,

    You can do that, by creating a style for the CellValuePresenter. You should apply that style to only the Age field, as it will disable itself (the cell) based on a condition - HasContent:

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

                <Style.Triggers>

                    <Trigger Property="HasContent" Value="True">

                        <Setter Property="IsEnabled" Value="False"/>

                    </Trigger>

                </Style.Triggers>

            </Style>

    Let me know if that works in your scenario.

Reply Children