开发者

To change gridview cell font size in WPF

I have a GridView in a Listview.View in a WPF application. I am using sorting of each grid view column so I need to set display member binding. When I searched in net I got a method using cell template to increase the font size of elements in th开发者_如何学JAVAe grid view. But I cannot use that since I need DisplayMemberBinding property of gridview for sorting. Any other method to increase the FontSize of the elements in GridView?


I realize this is an older post, but just in case someone was looking for an answer to the same question...

You should be able to simply set the Width property. This is pulled straight from a project I'm working on:

<ListView.View>
    <GridView>
        <GridViewColumn Width="50" Header="Id" DisplayMemberBinding="{Binding Id}" />
        <GridViewColumn Width="135" Header="First Name" DisplayMemberBinding="{Binding FirstName}" />
        <GridViewColumn Width="165" Header="Last Name" DisplayMemberBinding="{Binding LastName}" />
        <GridViewColumn Width="100" Header="Passcode" DisplayMemberBinding="{Binding Passcode}" />
        <GridViewColumn Width="125" Header="Type" DisplayMemberBinding="{Binding AccountType}" />
    </GridView>
</ListView.View>

This works just fine for me.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜