I need to get the exact DataGridColumn that is associated with the DataGridColumnHeader. So, basically: fill in the gaps in the following code: :)
DataGridColumnHeader myHeader; // this is a given value
DataGridColumn myColumn = SomeCoolMethod(myHeader);
public DataGridColumn SomeCoolMethod(DataGridColumnHeader header)
{
// ???
}
Ok, some more text - I can travel up the visual tree but it seems, that the real headers are contained in a separate branch or something. I get to my DataGrid visual without encountering any DataGridColumns. I am not sure where to search for the initial column and then - how do I find this specific column that caused the header?