Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Error highlight: the background color change to another row after highlight background and use scrollbar to roll in datagrid

$
0
0

Video

https://docs.google.com/file/d/0Bxs_ao6uuBDUTE1hV3Y3aHdVQkk/edit?usp=sharing

i use datagrid,

the background color change to another row after highlight background and use scrollbar to roll in datagrid

and then scroll bar the original i highlighted row, it have color correct. only do not know why scroll to another row the color is like following my scrollbar

private void myGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)

SolidColorBrush yellowBrush = new SolidColorBrush(Colors.Yellow);
                                e.Row.Background = yellowBrush;
<DataGrid AutoGenerateColumns="True" ItemsSource="{Binding}" Name="myGrid" 
                HorizontalAlignment="Left" Margin="10,23,0,0" VerticalAlignment="Top" 
                RenderTransformOrigin="-23.633,-5.198" Height="380" Width="811" 
                CellEditEnding="myGrid_CellEditEnding" Sorting="myGrid_Sorting" Grid.Row="1"><DataGrid.Columns><DataGridTemplateColumn><DataGridTemplateColumn.CellTemplate><DataTemplate><!--<Button Content="Delete" x:Name="btnDelete" Click="btnDelete_Click" IsEnabled="{Binding Path=BoolProp}"></Button>--><Button Content="Delete" x:Name="btnDelete" Click="btnDelete_Click" ><Button.IsEnabled><MultiBinding Converter="{StaticResource enableDisableConverter}"><Binding Path="." RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}}" /><Binding Path="Items.Count" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}" /></MultiBinding></Button.IsEnabled></Button></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn></DataGrid.Columns></DataGrid>



Still not start a love story, not start yet





Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>