I have a WPF app with a DataGrid. I'm using AutoGenerateColumns="True"
to fill it because the column and row count ain't always the same.
The problem is that it automatically generates only Column headers not the Row ones. So I decided to do what they did here: http://tech.pro/tutorial/1055/wpf-datagrid-tutorial-row-headers but I can't put the AutoGenerateColumns="False"
since I'm binding there a DataTable from DataSet which is not always same size - the headers don't always contain the same texts.
With the code from link above I have both column and row headers(this one is set by manually binding it in the xaml code) but I still got there the first(headers) column too. I can't erase the first column - exception will go out.
Any hints how to get row headers without setting them manually as in the link? OR any ideas how to delete the first column which I'm using as row headers?
P.S.: I know people were asking about something like this here already, but I didn't found any question with the same problem like me and with an answer that would help me :|
you can create a style in code :
and remove this field on AutoGeneratingColumn Event :