开发者

Access GridViewColumnHeader object from GridViewColumn

is it possible in wpf to access the header of a gridviewcolumn as gridviewcolumnheader?

I have an object:

开发者_JS百科GridViewColumn column;

But the "Header" property just returns a string (header text) not the "real" header object.

Can anyone help my?


I am myself very inexperianced with WPF... however it appears that that if you you do not define a GridViewColumnHeader, then you will not be given one when accessing .Header.

That is to say, if you define your GridViewColumn as:

                <GridViewColumn x:Name="stringColumn">
                    stringColumn.Header will return a string
                </GridViewColumn>

Then calling stringColumn.Header will return a string... however if you define it as say:

                <GridViewColumn x:Name="gridViewColumnHeaderColumn1">
                    <GridViewColumnHeader>
                        gridViewColumnHeaderColumn.Header will return a GridViewColumnHeaderColumn
                    </GridViewColumnHeader>
                </GridViewColumn>

Then checking gridViewColumnHeaderColumn.Header will return a GridViewColumnHeaderColumn


I've summarized different ways to find GridViewColumnHeader from GridViewColumn here: http://apaers.com/wpf-listview-access-gridviewcolumnheader-from-gridviewcolumn/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜