I have a datagrid where I created the columns in the designer. Later I would like to make further settings here.
For example header icon, summary line and some more, because the designer is a great tool.
At runtime I want to fill the Datagrid with the data. The source of the data is a ConcurrentDictionary(string, data class) which I first write into a data table and then into a DataSet which is then the data source of the data for the Datagrid.
Enclosed you can find my example.
With PopulateColumns() I can see the data but unfortunately the columns from the data table and not the columns from the designer
If I leave gridView.PopulateColumns() gone, the desired columns from the designer are there but I don't see any data.
How do I customize my code so that the columns are used by the designer and all other things by the designer and only the data is loaded into the datagrid at runtime?
Many thanks in advance.
I did it myself. Yippi.
The trick is to set the property "FieldName" in the designer to the same name as the column in the data table.
Then the columns from the designer are used and not those from the data table.
I have adapted the project and made it available for all those who stumble across the same problem.
If you know how to do it, it's easy :-)