문제

Context: I have a search box above my grid.

When I click from my search box into the grid I want it to select a row. It doesn't. Instead it appears to be setting the focus on the grid. I can click again to select a row. Technically that makes sense, but it's not intuitive for the general user.

Here is the XML for the grid:

<telerik:RadGridView Name="poRadGridView" 
                     Grid.Row="1"
                     SelectionUnit="FullRow" 
                     HorizontalAlignment="Center" 
                     IsReadOnly="True" 
                     VerticalAlignment="Top" 
                     ItemsSource="{Binding POs}" 
                     AutoGenerateColumns="False" 
                     FontSize="25" 
                     SelectionMode="Single"
                     ScrollViewer.CanContentScroll="True">
도움이 되었습니까?

해결책

One thing I didn't mention is I was using the row selection event to identify when the selected row changed. I'm using MVVM it was recommended that I identify changes in the selected row through data binding rather than event monitoring. So the following was added to the RadGridView definition:

SelectedItem="{Binding SelectedPO, Mode=TwoWay}"

For some reason this works.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top