Hi,
I have a flat datasource shown in the following screenshot:
I'd like to have three bands: Patient, Encounter, EncounterService as shown in this screenshot:
How do I achieve this result? Thank you in advance.
John King
Hello John,
Thank you for your feedback.
As Dimitar wrote you the grid shows the data as it is. So if you have a hierarchical data the grid will show it as hierarchical, e.g. band with child bands and etc. If your data is flat data table the grid will show only one band representing this data table. The grid does not shape the data, it only represents the data. So if you need hierarchical representation you need to feed the grid with hierarchical data source.
In your case you may iterate all the rows coming from the SQL server and create the necessary data tables representing the Patient, Encounter and Encounter Service. Then you should add the necessary relations between these tables and set the parent table (Patient in your case) as grid's data source. More about working with data tables you may find by following the next link to MSDN https://msdn.microsoft.com/en-us/library/system.data.datatable%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
Thank you for using Infragistics Controls.
Hi Dimitar,
Thanks for the quick reply.
In design-time I have created a hierarchical data structure with three tables, Patient, Encounter, and EncounterService related to each other. Then I bound the grid to that data structure. Since in run-time I have a flat result set coming from SQL Server, what do I need to do to populate my hierarchical data structure?
Thanks again,
Hi John,
Thank you for posting in our forums.
Your data source needs to have three hierarchies linked between each other in order for the grid to be able to show the three bands. So you will need to transform your flat data source to a hierarchical data source. That means that if you are using a DataSet, you will need to have three DataTables representing the Patient, the Encounter and the EcounterService, with the relations between them. If you are using a list, the Patient class needs to have a list property for the encounters and the Encounter class needs to have a list for the EncounterService class.
Please let me know if you have any additional questions.