简体   繁体   English

WPF Datagrid列标题页脚

[英]WPF Datagrid Column Header Footer

I am using WPF data grid. 我正在使用WPF数据网格。 I want to utilize last column which is just above the scroll viewer. 我想利用滚动查看器上方的最后一列。

something like this 像这样的东西 在此处输入图片说明

I want to add ~F in that highlited column. 我想在该高亮列中添加〜F。 Note that this should not be another column. 请注意,这不应是另一列。 I can add as another column but that will no suffice my requirement. 我可以添加为另一列,但这不能满足我的要求。

Thanks 谢谢

Praveen 普利文

I am not sure it can help, but way not simply adding a label that will display on top of the datagrid? 我不确定它是否有帮助,但是不是简单地添加一个将显示在数据网格顶部的标签吗? Just make sure that the Label is connected to the right size of the DataGrid container. 只需确保将Label连接到DataGrid容器的正确大小即可。

Just an idea (code is conceptual - not working) 只是一个想法(代码是概念性的-不起作用)

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="auto"/>
        <ColumnDefinition Width="5"/>
        </Grid.ColumnDefinitions>
    </Grid.ColumnDefinitions>
    <DataGrid Grid.Col="0" Grid.ColSpan="2"...../>
    <Label Grid.Col="1" Content="F%" />
</Grid>

That way, your dataGrid will take 2 columns, and the label will display on top of the datagrid, but in the 2nd column 这样,您的dataGrid将占据2列,并且标签将显示在datagrid的顶部,但在第二列

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM