简体   繁体   中英

WPF Datagrid Column Header Footer

I am using WPF data grid. 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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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