I have a WPF page when the standard WPF TabItem that contains SfDataGrid. The item source is bound to an ObservableCollection. When I select the tab that contains the SfDataGrid, it does not render on the screen unless there is at least 2 items in the item source collection. Below is the XAML for the TabItem containing the grid view.
SVSrinivasan Vasu Syncfusion Team August 16, 2016 12:43 PM UTC
Thank you for contacting Syncfusion support.
We have analyzed your query. We are not able to reproduce the reported “SfDataGrid nested in TabItem does not render when ItemSource only contains a single item” issue. For your reference we have attached the tested sample in the below sample location, please revert by modifying the attached sample based on your application along with the replication procedure. It will be helpful for us to analyze further.
I will not be able to modify the example to reproduce since it requires an external data source contained within our network. I can attempt to explain the scenario below.
Here is the flow of the application to get to the point where the SfDataGrid fails to render properly:
1. User selects a Project and is taken to a project page that has a list of Isometric drawings
2. User selects which drawing they would like to view data for and clicks Open
3. User is taken to the Isometric details page which contains two tabs each with a SfDataGrid. To get the data we pass the Isometric ID to the Page contstructor, use that ID to query the database asynchronously for the proper Isometric data. We then pass that Isometric data into the ViewModel constructor. The Page DataContext is set to the new ViewModel in the Page.cs.
For whatever reason, when there is only 1 item in the non-visible tab it does not render. If I take both grids out of the Tab control and stack them on the page vertically, they both render properly. If I use the same data and bind to the standard C# DataGrid control, it renders inside the tab fine.
BHBrandon HankinsAugust 16, 2016 05:30 PM UTC
I have resolved the issue. I was overriding the template in App.xaml in order to globally set border colors and something was inadvertently changed when I copied the default template in Blend.
Sorry for the inconvenience.
SVSrinivasan Vasu Syncfusion Team August 17, 2016 02:23 AM UTC