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.
<TabItem x:Name="WeldsTab"
IsSelected="True">
<TabItem.Header>
<TextBlock Text="Welds" />
</TabItem.Header>
<StackPanel Margin="20,20,15,0">
<sfGrid:SfDataGrid x:Name="WeldsGrid"
ItemsSource="{Binding CurrentIsometric.Welds}"
SelectedItem="{Binding SelectedWeld, Mode=TwoWay}"
LiveDataUpdateMode="AllowDataShaping"
AddNewRowPosition="None"
HeaderRowHeight="60"
RowValidating="WeldsGrid_RowValidating"
CurrentCellValidating="WeldsGrid_CurrentCellValidating"
GridCopyOption="CopyData,IncludeFormat"
AllowEditing="True"
AllowDeleting="True"
AllowFiltering="True"
AllowResizingColumns="True"
AutoGenerateColumns="False"
Height="670"
SelectionMode="Extended"
SelectionUnit="Cell"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0">
<sfGrid:SfDataGrid.Columns>
<sfGrid:GridCheckBoxColumn MappingName="DeleteWeld"
HeaderText="Delete"
Width="75"
AllowFiltering="False"/>
<sfGrid:GridCheckBoxColumn MappingName="VoidWeld"
HeaderText="Void"
Width="75"
AllowFiltering="False"/>
<sfGrid:GridTextColumn MappingName="ShopWeldFieldWeld"
HeaderText="FieldWeld/ShopWeld"
Width="100"/>
<sfGrid:GridTextColumn MappingName="WeldClass"
HeaderText="Weld Class"
Width="100"/>
<sfGrid:GridTextColumn MappingName="WeldNumber"
HeaderText="Weld No."
AllowEditing="False"
Width="75"/>
<sfGrid:GridTextColumn MappingName="SpecificationNumber"
HeaderText="Spec No."
Width="75"/>
<sfGrid:GridTextColumn MappingName="WeldType"
HeaderText="Weld Type"
Width="100"/>
<sfGrid:GridTextColumn MappingName="Grade"
HeaderText="Grade"
Width="75"/>
<sfGrid:GridTextColumn MappingName="PNumber"
HeaderText="P#"
Width="75"/>
<sfGrid:GridNumericColumn MappingName="PipeDiameter"
HeaderText="Dia. Inches"
NumberDecimalDigits="2"
Width="75"/>
<sfGrid:GridTextColumn MappingName="Schedule"
HeaderText="Schedule"
Width="100"/>
<sfGrid:GridTextColumn MappingName="Welder"
HeaderText="Welder"
Width="80"/>
<!--<sfGrid:GridTemplateColumn>
<sfGrid:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Welder.RNumber}" />
</DataTemplate>
</sfGrid:GridTemplateColumn.CellTemplate>
<sfGrid:GridTemplateColumn.EditTemplate>
<DataTemplate>
<sfInput:SfTextBoxExt Style="{DynamicResource DefaultTextBox}"
Width="230"
DataContext="{Binding ViewIsoViewModel, RelativeSource={RelativeSource Self }}"
AutoCompleteMode="Suggest"
AutoCompleteSource="{Binding Welders.Name}"
SearchItemPath="Name"
SelectedItem="{Binding Welder, Mode=TwoWay}" />
</DataTemplate>
</sfGrid:GridTemplateColumn.EditTemplate>
</sfGrid:GridTemplateColumn>-->
<sfGrid:GridTextColumn MappingName="WeldDate"
HeaderText="Weld Date"
DisplayBinding="{Binding WeldDate, Converter={StaticResource shortDateConverter}}"
Width="75"/>
<sfGrid:GridTextColumn MappingName="WpsNumber"
HeaderText="WPS"
Width="75"/>
<sfGrid:GridTextColumn MappingName="PWHTCycle"
HeaderText="PWHT Cycle Temp/Time"
Width="100"/>
<sfGrid:GridTextColumn MappingName="VisualCheck"
HeaderText="Visual Check"
Width="75"/>
<sfGrid:GridTextColumn MappingName="InspectorId"
HeaderText="Inspector Id"
Width="100"/>
<sfGrid:GridTextColumn MappingName="InspectionDate"
HeaderText="Inspection Date"
Width="100"/>
<sfGrid:GridTextColumn MappingName="RadioGraphicTest"
HeaderText="Radiographic Test"
Width="100"/>
<sfGrid:GridTextColumn MappingName="PtmtStatus"
HeaderText="MT/PT Test"
Width="100"/>
<sfGrid:GridTextColumn MappingName="HardnessTest"
HeaderText="Hardness Test"
Width="100"/>
<sfGrid:GridTextColumn MappingName="FitUpStatus"
HeaderText="Fit Up Status"
Width="100"/>
<sfGrid:GridTextColumn MappingName="PreHeatTemp"
HeaderText="Pre-Heat/Interpass Temp"
Width="100"/>
<sfGrid:GridTextColumn MappingName="MaterialType"
HeaderText="Material (SA)"
Width="100"/>
<sfGrid:GridTextColumn MappingName="PWHTStatus"
HeaderText="PWHT Status"
Width="100"/>
</sfGrid:SfDataGrid.Columns>
<sfGrid:SfDataGrid.SortComparers>
<Linq:SortComparer Comparer="{StaticResource WeldNumberSorter}" PropertyName="WeldNumber"/>
</sfGrid:SfDataGrid.SortComparers>
</sfGrid:SfDataGrid>
<TextBlock Text="{Binding UpdateSpoolsAndWeldsMessage}"
HorizontalAlignment="Right"
Margin="0,20,0,0"
Foreground="{Binding UpdateSpoolsAndWeldsMessageColor}"/>
<StackPanel Orientation="Horizontal" Margin="1272,0,0,0">
<Button Command="{Binding AddWelds}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,0,20,0"
Style="{DynamicResource DefaultActionButton}"
Content="Add Welds"
Grid.Row="3"/>
<Button Command="{Binding UpdateWeldsAndSpools}"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0"
Style="{DynamicResource DefaultActionButton}"
Content="Save Changes"
Grid.Row="3"/>
</StackPanel>
</StackPanel>
</TabItem>