Hi,
I have the following scenario, I have a datasource that is made of several datatables, the datatables are created from custom queries on a database and are put in a dataset, where I create the relations building Master/Detail data.
The Grid and all its content is custom made so I create them at runtime.
When I create the MasterGrid I set
- AutogenerateColumns = True
- AutogenerateRelations = True
- AutogeneratingRelations += MyRelationsGeneratingEventHandler
- AutogeneratingColumns += MyAutogeneratingColumnsEventHandler
In MyRelationsGeneratingEventHandler, for each child grid generated I set:
- AutoGenerateColumns = True
- AutoGenerateRelations = True
- AutoGeneratingRelations = MyRelationsGeneratingEventHandler
- AutoGeneratingColumns = MyAutoGeneratingColumnsEventHandler
In the MyRelationsGeneratingEventHandler I also set all properties for the child grids and what is set in this event handler is correct (so for example the Filter Row and the Styles for row, header, alternate row are correct)
However, the MyAutoGeneratingColumnsEventHandler, is executed correctly only on the MasterGrid, and it is executed just one time in a strange way the first time I expand a details grid with no information on the Grid and the ItemsSource.
It is not executed for all columns of the Details grids.
So I presume I have not set the event handler correctly. From here the question.
How can I assign the AutoGeneratingColumns event handler to the details grids when they are generated by the AutoGenerateRelations?
I need to be able to format the columns of the child grids to give them the right format based on the data they are handling.
Or if it is not the right event, which is the right event???
Thank you in advance
Regards
Sabrina