Accessing the WPF DataGrid "empty" or "rowcolumn" header
I am trying to get access to the header that is at the intersection of the rows and columns headers in a Net3.5 WPF DataGrid.
Josh Smith calls this the "Empty Header" in an article on a different grid control and I w开发者_开发技巧ould call it the "RowColumn" header since it in the first position for both the column and row headers and is the only header that is part of both. It defaults to a button with a lower right hand arrow that when you press selects all the items in the DataGrid. I can see this button in snoop but cannot work out how to get access to this header.
I need to stop the button selecting all the items in the grid and add either a menu in its place or a context menu that is keeping the button but adding text to it.
Since I am unclear about what this is even called in the documentation, I have no idea what to search on. I have tried the, to me, obvious ones.
It took me awhile to find this, decided I wanted to take on the challenge myself since I didn't know the answer straight away. There is not a built in control for that button in the top left, which makes it a little more complicated. The good news is, you can override the "SelectAllButtonTemplate" on load.
I'm not sure what you want to replace it with, but here is a tutorial on how to do it. Also you might find this past question helpful. Good luck sir.
精彩评论