We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sflistview header errorr: "Invalid xaml: object reference not set to an instance of an object error"

I am getting an invalid xaml error in xamarin forms previewer and the page does not render in the emulator.  I am trying to add a header to my sfllistview which is working fine.  My xaml code is below.  Can someone please tell me what is wrong with my xaml?  



  <ContentPage.BindingContext>

    <local:MatterStatusInfoReposititory x:Name="viewModel" />

  </ContentPage.BindingContext>

  <ContentPage.Content>

    <sync:SfListView x:Name="MatterListView"

                      ItemsSource="{Binding MatterStatusList}"

                      ItemSize="100">


      <sync:SfListView.HeaderTemplate>

        <DataTemplate>

          <Label LineBreakMode="NoWrap"

                          TextColor="#6BBE29"

                          Text="{Binding ClientName}"

                           FontAttributes="Bold"></Label>

        </DataTemplate>

      </sync:SfListView.HeaderTemplate>

      <sync:SfListView.ItemTemplate>

        <DataTemplate>

          <ViewCell>

            <ViewCell.View>

              <Grid x:Name="grid" RowSpacing="0">

                <Grid.RowDefinitions>

                  <RowDefinition Height="*" />

                  <RowDefinition Height="1" />

                </Grid.RowDefinitions>

                <Grid RowSpacing="0" Padding="5,10,5,10">

                  <Grid.ColumnDefinitions>

                    <ColumnDefinition Width="0" />

                    <ColumnDefinition Width="*" />

                    <ColumnDefinition Width="30" />

                  </Grid.ColumnDefinitions>



                  <Grid Grid.Column="1"

                        RowSpacing="0"

                        Padding="0,0,0,0"

                        VerticalOptions="Center">

                    <Grid.RowDefinitions>

                      <RowDefinition Height="*" />

                      <RowDefinition Height="*" />

                      <RowDefinition Height="*" />

                      <RowDefinition Height="*" />

                      <RowDefinition Height="*" />

                    </Grid.RowDefinitions>


                    <Label LineBreakMode="NoWrap"

                           TextColor="#6BBE29"

                           Text="{Binding ClientName}"

                            FontAttributes="Bold">

                      <Label.FontSize>

                        <OnPlatform x:TypeArguments="x:Double">

                          <OnPlatform.WinPhone>

                            <OnIdiom x:TypeArguments="x:Double" Phone="16" Tablet="20" />

                          </OnPlatform.WinPhone>

                          <OnPlatform.Android>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="16"

                                     Tablet="18" />

                          </OnPlatform.Android>

                          <OnPlatform.iOS>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="16"

                                     Tablet="22" />

                          </OnPlatform.iOS>

                        </OnPlatform>

                      </Label.FontSize>

                    </Label>


                    <Label Grid.Row="1"

                           Grid.Column="0"

                           TextColor="#474747"

                           LineBreakMode="NoWrap"

                           Text="{Binding MatterName}">

                      <Label.FontSize>

                        <OnPlatform x:TypeArguments="x:Double">

                          <OnPlatform.WinPhone>

                            <OnIdiom x:TypeArguments="x:Double" Phone="15" Tablet="12" />

                          </OnPlatform.WinPhone>

                          <OnPlatform.Android>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="15"

                                     Tablet="14" />

                          </OnPlatform.Android>

                          <OnPlatform.iOS>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="15"

                                     Tablet="14" />

                          </OnPlatform.iOS>

                        </OnPlatform>

                      </Label.FontSize>

                    </Label>


                    <Label Grid.Row="2"

                           Grid.Column="0"

                           TextColor="#474747"

                           LineBreakMode="NoWrap"

                           Text="{Binding NMSID}">

                      <Label.FontSize>

                        <OnPlatform x:TypeArguments="x:Double">

                          <OnPlatform.WinPhone>

                            <OnIdiom x:TypeArguments="x:Double" Phone="15" Tablet="12" />

                          </OnPlatform.WinPhone>

                          <OnPlatform.Android>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="15"

                                     Tablet="15" />

                          </OnPlatform.Android>

                          <OnPlatform.iOS>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="15"

                                     Tablet="15" />

                          </OnPlatform.iOS>

                        </OnPlatform>

                      </Label.FontSize>

                    </Label>


                    <Label Grid.Row="3"

                           Grid.Column="0"

                           TextColor="#474747"

                           LineBreakMode="NoWrap"

                           Text="{Binding OpenDate}">

                      <Label.FontSize>

                        <OnPlatform x:TypeArguments="x:Double">

                          <OnPlatform.WinPhone>

                            <OnIdiom x:TypeArguments="x:Double" Phone="15" Tablet="12" />

                          </OnPlatform.WinPhone>

                          <OnPlatform.Android>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="15"

                                     Tablet="15" />

                          </OnPlatform.Android>

                          <OnPlatform.iOS>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="15"

                                     Tablet="15" />

                          </OnPlatform.iOS>

                        </OnPlatform>

                      </Label.FontSize>

                    </Label>



                    <Label Grid.Row="4"

                           Grid.Column="0"

                           TextColor="#474747"

                           LineBreakMode="NoWrap"

                           Text="{Binding Status}">

                      <Label.FontSize>

                        <OnPlatform x:TypeArguments="x:Double">

                          <OnPlatform.WinPhone>

                            <OnIdiom x:TypeArguments="x:Double" Phone="14" Tablet="12" />

                          </OnPlatform.WinPhone>

                          <OnPlatform.Android>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="14"

                                     Tablet="14" />

                          </OnPlatform.Android>

                          <OnPlatform.iOS>

                            <OnIdiom x:TypeArguments="x:Double"

                                     Phone="14"

                                     Tablet="14" />

                          </OnPlatform.iOS>

                        </OnPlatform>

                      </Label.FontSize>

                    </Label>


                  </Grid>



                  <Grid Grid.Row="0"

                        Grid.Column="2"

                        RowSpacing="0"

                        HorizontalOptions="End">


                    <Image Source="Forward-Filled2.png"

                            VerticalOptions="Center"

                            HorizontalOptions="Center"

                            HeightRequest="25"/>


                  </Grid>

                </Grid>

                <Frame Grid.Row="1" OutlineColor="#E4E4E4" HasShadow="False" HeightRequest=".5"/>

              </Grid>

            </ViewCell.View>

          </ViewCell>

        </DataTemplate>

      </sync:SfListView.ItemTemplate>



    </sync:SfListView>


  </ContentPage.Content>


1 Reply

DB Dinesh Babu Yadav Syncfusion Team February 17, 2017 12:54 PM UTC

Hi Darrell,   
   
Thanks for using Syncfusion products.   
   
We are able to reproduce the reported “SfListView crashes in Xamarin Previewer(Designer)” issue and we have logged a defect report this. A support incident has been created under your account to track the status of this report. Please log on to our support website to check for further updates.     
  
   
Please let us know if you need any further assistance.   
   
Regards,   
Dinesh Babu Yadav 


Loader.
Live Chat Icon For mobile
Up arrow icon