user1473885
user1473885

Reputation: 11

How to disable listviewitem row based on column value

Please help me on

Disabling listviewitem based on one of the column property.

Say, In a listview row if i checked some check box, then i have to disable that row.

Regards, Raman

Upvotes: 0

Views: 732

Answers (1)

Alex
Alex

Reputation: 907

    <ListView>
        <ListView.ItemTemplate>
            <DataTemplate >
                <StackPanel Orientation="Horizontal">
                    <Label Content="{Binding}"  IsEnabled="{Binding ElementName=ch,Path=IsChecked}"/>
                    <CheckBox Name="ch"/>
                </StackPanel>
            </DataTemplate>
        </ListView.ItemTemplate>
        <ListBoxItem Content="item 1"/>
        <ListBoxItem Content="item 2"/>
    </ListView>

Upvotes: 1

Related Questions