开发者

Disable focus on a WPF Telerik RadGrid Row

开发者 https://www.devze.com 2023-02-14 14:47 出处:网络
I have a WPF Telerik RadGrid View, in which the row should have different colors based on a boolean. I was able to do this with data triggers, but the problem is that I was unable to disable the mouse

I have a WPF Telerik RadGrid View, in which the row should have different colors based on a boolean. I was able to do this with data triggers, but the problem is that I was unable to disable the mouse over and select effects on the row. As a result, even though a particular row has a different color due to the boolean, when the mouse moves over or when the row is selected, it gets selected/mouse over color effect. Is there a way I can disable the mouse over and selected properties for a particular row? Setting the IsSelected and Focusable properties to false also didn't make any difference. The style and data triggers is as follows:

<Style x:Key="RadRowStyle" TargetType="{x:Type telerik:GridViewRow}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding ABC}" Value="True">
                <Setter Property="Background" Value="Blue"/>
                <Setter Property="IsSelected" Value="False"/>
                <Setter Property="Focusable" Value="False"/>
                <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            </DataTrigger>
            <DataTrigger Bin开发者_如何学Goding="{Binding ABC}" Value="false">
                <Setter Property="Background" Value="Transparent"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>


For selected items you can clear them in the code with:

MyGridView.SelectedItem = null;

I'm still looking for an easy way to disable mouse over...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号