at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnMeasure (System.Double widthConstraint, System.Double heightConstraint)

Hi,

i have this exception in android device, with the latest version

Here below the xaml  of the datagrid

 <syncfusion:SfDataGrid x:Name="ListArtForNewDoc"
                                   Margin="1,2,1,1"
                                   ItemsSource="{Binding Documento_Righe}"
                                   GridStyle="{StaticResource mystylegrid}"                                   
                                   EditTapAction="OnTap"
                                   AllowSorting ="True"
                                   SortTapAction="DoubleTap"
                                   AllowTriStateSorting="True"
                                   AllowSwiping="True"  
                                   MaxSwipeOffset="80"                                
                                   AllowMultiSorting="False"
                                   AutoGenerateColumns="False"
                                   AllowGroupExpandCollapse="True"                                   
                                   EditorSelectionBehavior="SelectAll"
                                   SelectionMode="Multiple"
                                   AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1"
                                   IsEnabled="{Binding IsEnableEdit}"
                                   GridTappedCommand="{Binding RicaluateRowCommand}">

                <syncfusion:SfDataGrid.LeftSwipeTemplate>
                    <DataTemplate>
                        <Grid ColumnSpacing="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Grid Grid.Column="0" BackgroundColor="{StaticResource Primary}">
                                <Label Style="{StaticResource FontIcon}" TextColor="White" Text="{x:Static iMioCore:FontAwesomeFont.Euro}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontSize="20" />
                                <Grid.GestureRecognizers>
                                    <TapGestureRecognizer Command="{Binding Path=BindingContext.AnalisiPrezziCommand, Source={x:Reference ListArtForNewDoc}}" CommandParameter="{Binding .}"/>
                                </Grid.GestureRecognizers>
                            </Grid>

                            <Grid Grid.Column="1" BackgroundColor="{StaticResource Primary}">
                                <Label Style="{StaticResource FontIcon}" TextColor="White" Text="{x:Static iMioCore:FontAwesomeFont.Boxes}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontSize="20" />
                                <Grid.GestureRecognizers>
                                    <TapGestureRecognizer Command="{Binding Path=BindingContext.AnalisiMagazzinoCommand, Source={x:Reference ListArtForNewDoc}}" CommandParameter="{Binding .}"/>
                                </Grid.GestureRecognizers>
                            </Grid>

                        </Grid>
                    </DataTemplate>
                </syncfusion:SfDataGrid.LeftSwipeTemplate>

                <syncfusion:SfDataGrid.RightSwipeTemplate>
                    <DataTemplate>
                        <Grid BackgroundColor="{StaticResource ButtonDeleteColor}">
                            <Label Style="{StaticResource FontIcon}" TextColor="White" Text="{x:Static iMioCore:FontAwesomeFont.Trash}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" FontSize="20" />
                            <Grid.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding Path=BindingContext.DeleteRowCommand, Source={x:Reference ListArtForNewDoc}}" CommandParameter="{Binding .}"/>
                            </Grid.GestureRecognizers>
                        </Grid>
                    </DataTemplate>
                </syncfusion:SfDataGrid.RightSwipeTemplate>

                <syncfusion:SfDataGrid.Columns>
                    <syncfusion:GridTextColumn HeaderText="N." MappingName="Riga" Width="30" HeaderTextAlignment="Center" TextAlignment="Center" />
                    <syncfusion:GridTextColumn HeaderText="ARTICOLO" MappingName="IdArticolo" Width="150" HeaderTextAlignment="Start" TextAlignment="Start" />
                    <syncfusion:GridTextColumn HeaderText="DESCRIZIONE" MappingName="RigaDescriz" AllowEditing="False" ColumnSizer="LastColumnFill" HeaderTextAlignment="Start" TextAlignment="Start" />
                    <syncfusion:GridNumericColumn x:Name="ColQta" HeaderText="QTA" MappingName="Qta" AllowEditing="True" Width="60" HeaderTextAlignment="Start" />
                    <syncfusion:GridTextColumn HeaderText="SC 1" MappingName="PrezzoSconto" AllowEditing="True" Width="60" HeaderTextAlignment="Start" />
                    <syncfusion:GridNumericColumn HeaderText="SC 2" MappingName="Sconto2" AllowEditing="True" HeaderTextAlignment="Start" TextAlignment="End" Width="60" />
                    <syncfusion:GridNumericColumn x:Name="ColPrezzo" HeaderText="PREZZO" MappingName="PrezzoUnit" AllowEditing="True" Width="90" HeaderTextAlignment="Start" NumberDecimalSeparator="," NumberGroupSeparator="." NumberDecimalDigits="2" />
                    <syncfusion:GridNumericColumn x:Name="ColTotale" HeaderText="TOTALE" MappingName="PrezzoTot" Width="100" HeaderTextAlignment="Start" NumberDecimalSeparator="," NumberGroupSeparator="." NumberDecimalDigits="2" />
                    <syncfusion:GridTemplateColumn MappingName="TipoRiga" HeaderText="TIPO RIGA">
                        <syncfusion:GridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Label Text="{Binding TipoRiga, Converter={StaticResource ConverterImage}}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Style="{StaticResource FontIcon}" TextColor="{StaticResource Primary}" />
                            </DataTemplate>
                        </syncfusion:GridTemplateColumn.CellTemplate>
                    </syncfusion:GridTemplateColumn>

                </syncfusion:SfDataGrid.Columns>

                <syncfusion:SfDataGrid.SortColumnDescriptions>
                    <syncfusion:SortColumnDescription ColumnName="Riga" SortDirection="Ascending" />
                </syncfusion:SfDataGrid.SortColumnDescriptions>

            </syncfusion:SfDataGrid>

Best 
Alberto C.

7 Replies

AA Arulraj A Syncfusion Team August 24, 2018 01:14 PM UTC

Hi Alberto, 
 
We have analyzed your query where you have mentioned exception when using the given code with the android device with the latest version but there is no exception details or replication procedure to validate it from our end. Please provide the following details to validate the reported issue further.  
 
  • In which android device are you testing you application?, provide the device details with the android API version.
  • Provide the stack trace of the issue when you experience this exception.
  • Which version of Syncfusion Datagrid are you using?
  • Which forms version are you using in your application?
  • Please provide the replication procedure to validate the reported issue.
  • If possible, modify the attached sample to replicate the issue.
 
We have attached the tested sample and you can download it from the following link 
 
Regards,  
Arulraj A  



AL Alberto August 29, 2018 01:48 PM UTC

To replicate the error i have found another one an here below a show you the code modified and the answers to the your questions.

New code in xaml 

<sfgrid:SfDataGrid x:Name="ListArtForNewDoc"
                                   Margin="1,2,1,1"
                                   ItemsSource="{Binding Documento_Righe}">


</sfgrid:SfDataGrid>

In which android device are you testing you application?, provide the device details with the android API version.
Samsung Galaxy A6, Version Android 7.0

Provide the stack trace of the issue when you experience this exception.
  0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal C#
  0x1 in System.Diagnostics.Debugger.Mono_UnhandledException C#
  0x20 in object.31 C#
  0x12 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw C#
  0x6 in System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0 C#
  0xC in Android.App.SyncContext. C#
  0xE in Java.Lang.Thread.RunnableImplementor.Run C#
  0xA in Java.Lang.IRunnableInvoker.n_Run C#
  0x11 in object.31 C#

Which version of Syncfusion Datagrid are you using?
Syncfusion.Xamarin.Core 16.2.0.50
Syncfusion.Xamarin.DataSource 16.2.0.50
Syncfusion.Xamarin.SfDataGrid 16.2.0.50
Xamarin.Forms 3.1.0.697729


System.NullReferenceException: Object reference not set to an instance of an object.


    • Which forms version are you using in your application?
    what do you mean?


DY Deivaselvan Y Syncfusion Team August 30, 2018 12:06 PM UTC

Hi Alberto,

Thanks for the provided information.

We have analyzed with the given information and we have prepared a sample in .NetStandard with Xamarin.Forms 3.1 with the DataGrid hosted inside the AbsoluteLayout and validated the reported issue in the Android Motorolo G4 Plus device running with Android 7.0 where sample is working fine in the lastest SfDataGrid version 16.2.0.50 and we have also tested with various Layout such as Grid, StackLayout. It would be very helpful if you provide the parent settings of the DataGrid used in your application to validate the issue further from our side. If possible please modify the attached sample to replicate the issue. We have attached the tested sample and video footage and you can download from the following link

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid798522482  



AL Alberto August 31, 2018 09:03 AM UTC

Hi Ivan,


i have found the problem!!! This is teh structure of  page that i try to open 

 <sftabView:SfTabView x:Name="Tabviewdoc" Grid.Row="1" 
                                     TabHeaderBackgroundColor="{StaticResource Primary}" TabHeight="50"
                                     DisplayMode="Text" EnableSwiping="False">
                    <sftabView:SfTabView.SelectionIndicatorSettings>
                        <sftabView:SelectionIndicatorSettings Color="White" Position="Bottom" StrokeThickness="3" />
                    </sftabView:SfTabView.SelectionIndicatorSettings>

                    <iMioControls:mySfTabItem Title="Articoli">
                        <iMioControls:mySfTabItem.Content>
                            <iMioView:DocRowView />
                        </iMioControls:mySfTabItem.Content>
                    </iMioControls:mySfTabItem>

                </sftabView:SfTabView>

        <!--<iMioView:DocRowView Grid.Row="1"/>-->

The SfTabView give me this exception, version 16.2.0.50, if i open directly the contenview  without insert it in to the SfTabView i can see th grid.
Seems te are connected, and i have try to comment other piece of code inside DocRowView but but they don't have change anything.

So the problem is between sfTab e sfGrid.

Alberto C.




VR Vigneshkumar Ramasamy Syncfusion Team September 3, 2018 06:11 AM UTC

Hi Alberto,  
  
Sorry for the inconvenience caused.   
  
We have analyzed the reported issue with the provided code snippet. We can reproduce the reported issue when hosting the SfDataGrid inside the SfTabview with the version 16.2.0.50. We have already logged this bug as an internal issue and we will fix the issue and the fix will be included in the 2018 Volume 3 release, which is expected to be available by mid of September 2018. We appreciate your patience until then.  
  
Regards,  
Vigneshkumar R 



AL Alberto September 3, 2018 06:33 AM UTC

Hi Vigneshkumar,

don'yt worry, it is not simple ti reproduce any promblem without every piece of information.

So thanks a lot for your assistance and i wait the release.

Best
Alberto C.


VR Vigneshkumar Ramasamy Syncfusion Team September 4, 2018 09:35 AM UTC

Hi Alberto,   
   
Thanks for the update. As mentioned before the fix will be included in the 2018 Volume 3 release, which is expected to be available by mid of September 2018. We appreciate your patience until then.   
   
Regards,   
Vigneshkumar R  


Loader.
Up arrow icon