HI All,
XamDataGrid bind to a list of Employee with zero count is not showing Headers
xamDataGrid1.DataSource = empList;
Thank you for your help.
Hi pramodpogal,
I don't know the release version of the xamDataGrid component that you are using. It's possible the issue to result from the used version. In answer to your doubt - "If AutoGenerateFields property = "False" and i am adding the fields in xaml."you should take into account the following in relation to the AutoGenerateFields property: When AutoGenerateFields="False" the control seeks to find the FieldLayout that corresponds to the Type of the Data Item. We could have two possibilities:
- we can have a FieldLayout defining the Fields(columns) contained in a DataRecord from the DataSource(the same as the Fields(columns)); When a DataRecord is created, the FieldLayouts collection is searched for an existing FieldLayout whose Fields match the DataItem's properties. If a FieldLayout is found, it is associated with the DataRecord. In this case the Headers(Fields) will be visible even if the DataSource is empty.
- we can have a FieldLayout defining the Fields(columns) that are not contained in a DataRecord from the DataSource; When a DataRecord is created, the FieldLayouts collection is searched for an existing FieldLayout whose Fields match the DataItem's properties. If it is not found, a new FieldLayout is created. When a new FieldLayout is created, the FieldLayoutInitializing and FieldLayoutInitialized events are raised.
In this case the Headers(Fields) won't be visible.
Best Regards,Yanko
Hi Yanko
Thank You very much for your reply and sample.
I have a doubt. If AutoGenerateFields property = "False" and i am adding the fields in xaml.
Then the same problem is persisting. Please help me out in this also.
Thanks,
Pramod
I don't know what's wrong with your application but I could assure you that the xamDataGrid column headers are visible if you bind the xamDataGrid component to a generic List<T> with zero countand set the AutoGenerateFields property to "True". The attached xamDataGridColumnHeaderNotVisible sample application demonstrates the above-mentioned.