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
Row highlighting Issue
posted

Hello ,

I'm working with XamDataGrid, my task is to accomplish highlighting of a grid row. I have 2 grids one on the top and other on the bottom separated by GridSplitter. Below is the structure:

XAML1:

<Grid x:Uid="Grid_1">
<Grid.RowDefinitions>
<RowDefinition x:Uid="RowDefinition_1" Height="auto" />
<RowDefinition x:Uid="RowDefinition_2" Height="*" />
</Grid.RowDefinitions>
<Grid x:Uid="Grid_2" Grid.Row="0" Style="{StaticResource controlTitleHolder}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Uid="ColumnDefinition_1" Width="*" />
<ColumnDefinition x:Uid="ColumnDefinition_2" Width="auto" />
</Grid.ColumnDefinitions>

Row 0: Has a Label and a Clearable Text Box

<Grid x:Uid="Grid_2" Grid.Row="0" Style="{StaticResource controlTitleHolder}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Uid="ColumnDefinition_1" Width="*" />
<ColumnDefinition x:Uid="ColumnDefinition_2" Width="auto" />
</Grid.ColumnDefinitions>
<StackPanel x:Uid="StackPanel_1" Grid.Column="0" Orientation="Horizontal">
<TextBlock x:Uid="TextBlock_1" Style="{StaticResource controlTitle}" AutomationProperties.AutomationId="TextBlock_1">Checks</TextBlock>
<Viewbox x:Uid="Viewbox_1" Grid.Column="1" Style="{StaticResource sideTabButtonViewbox}" Margin="0 2 2 0" Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}">
<library:CircularProgressBar x:Uid="library:CircularProgressBar_1" ToolTip="Loading..." AutomationProperties.AutomationId="library:CircularProgressBar_1" />
</Viewbox>
</StackPanel>
<StackPanel x:Uid="StackPanel_2" Grid.Column="1" Orientation="Horizontal">
<Label x:Uid="Label_1" Foreground="White" AutomationProperties.AutomationId="Label_1">Search:</Label>
<library:ClearableTextBox x:Uid="library:ClearableTextBox_1" Grid.Column="1" Margin="0,2,2,2" Width="180" IsEnabled="{Binding IsSearchEnabled}" Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged}" Command="{Binding ClearFilter}" AutomationProperties.AutomationId="library:ClearableTextBox_1" />
</StackPanel>
</Grid>

Row 1: Has the DataGrid

XAML2:

Just like above I have 2 Rows with Row 0: Has a Label and a Clearable Text Box and Row 1: Has the DataGrid .


The above 2 are placed as controls in XAML3:

<Grid x:Uid="Grid_3" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition x:Uid="checkPaneLength" x:Name="checkPaneLength" Height="*" MinHeight="50" />
<RowDefinition x:Uid="RowDefinition_3" Height="auto" />
<RowDefinition x:Uid="taskPaneLength" x:Name="taskPaneLength" Height="200" MinHeight="50" />
</Grid.RowDefinitions>
<Controls:XAML1 x:Uid="paneChecks" Grid.Row="0" Background="{StaticResource controlBackground}" Margin="5 5 5 0" DataContext="{Binding XAML1ViewModel}" x:Name="paneChecks" />
<GridSplitter x:Uid="GridSplitter_1" Grid.Row="1" Height="5px" ResizeDirection="Rows" HorizontalAlignment="Stretch" Background="#335" />
<Controls:XAML2 x:Uid="pane" Grid.Row="2" Background="{StaticResource controlBackground}" Margin="5 0 5 5" DataContext="{Binding XAML2ViewModel}" x:Name="pane" />
</Grid>

Below is the activity and problem:

Steps:

1)When I select a row on grid in XAML1, it selects its child in grid on XAML2 and vice versa. Here it highlights both the selection with a goldenbrown color.

2)Next, when I search in the search box, it gives me lesser results on both grids, now I select parent on Grid in XAML1, it selects child on grid in XAML2.

3)When I clear the search box, it gives me back the original data set in both the grids.

4)Now when I try to repeat Step 1, it keeps the previous selection. For eg: If select a parent, it's child in other grid is selected. Now again if I select another row on the parent grid, it keeps the previous selected parent. 

Any idea why the above issue might occur, delay in event triggering or indisposed data or duration of the animations that are responsible for the transition of the colors or because I'm not refreshing the screen, is refreshing the screen a good idea?

Sorry if it's a basic question, I'm new to WPF.

Thanks for your time.

Thanks,

Ravi