开发者

ListView selection

In a ListView control by de开发者_运维知识库fault you select a row if you click on the content of a column but if you click on the row out of bounds of content then it wont select the row. Is there any quick way to do it expect specifying templates for each column?

I've tried (this actually works for ListBox ):

<Style TargetType="{x:Type ListViewItem}" 
       BasedOn="{StaticResource {x:Type ListViewItem}}">
   <Setter Property="Background" Value="#01000000" />
</Style>


I had a similar problem with ListView (did not test it with ListBox). Hopefully this will apply. I know this is not a tested answer but I cannot post code in a comment. If it does not work please let me know and I will remove it.

    <ListView ... >
        <ListView.ItemContainerStyle>
            <Style TargetType="ListViewItem">
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            </Style>
        </ListView.ItemContainerStyle>
        <ListView.View>
        ...
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜