Search Results

Search found 2 results on 1 pages for 'ozczecho'.

Page 1/1 | 1 

  • WPF ListView SelectedItem is null

    - by ozczecho
    Hi All I have a Listview that has a checkbox as one of the columns. If I click anywhere but the actual checkbox the SelectedItem of the ListView is set to the current selected row, as expected. If, on the other hand I click onto the checkbox (without clicking on the row first) then the SelectedItem is null or the previously clicked row. Can anyone help me out.... Cheers <ListView Width="auto" SelectionMode="Single" x:Name="listBox" ItemsSource="{Binding MyData}" SelectedItem="{Binding Path=SelectedMyData}"> <ListView.View> <GridView> <GridViewColumn Header="Date" Width="120"> <GridViewColumn.CellTemplate> <DataTemplate> <ContentPresenter Style="{StaticResource DateTimeContent}" Content="{Binding MyDate}"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <CheckBox IsThreeState="False" Checked="OnChkChecked" Unchecked="OnChkChecked" IsChecked="{Binding IsCorrect}"></CheckBox> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> </ListView>

    Read the article

  • WPF Trigger / Style overrides another

    - by ozczecho
    I have a listview defined as such <ListView Width="auto" SelectionMode="Single" ItemContainerStyle="{StaticResource baseListViewStyle}" .... Then in "baseListViewStyle" I have defined some base styles to apply to my list views, including a Style trigger: <Style x:Key="baseListViewStyle" TargetType="ListViewItem"> <Setter Property="Height" Value="20" /> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Red" /> </Trigger> </Style.Triggers> </Style> The trigger here highlights the row when mouse is over it. Nice. I also have a Data Trigger on the listviewitem: <Style.Triggers> <DataTrigger Binding="{Binding IsTestTrue}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard Storyboard="{StaticResource SomeFunkyAnimation}" /> </DataTrigger.EnterActions> </DataTrigger> If test is true then a nice little fade animation is played out. This all works except when I move my mouse over the row where "test is true" the animation stops and the mouse over style is displayed. Any ideas how I can override that style in my DataTrigger? TIA

    Read the article

1