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 crashes my app when navigate back to main page.

I am working with xamarin forms and i used sflistview, this is working fine on android and ios when coming to windows my app is crashes when navigate to sflistview main page,

i cant handle the crash report, and i don't no what is going on and the final exception showing Object reference not set to an instance of an object.

5 Replies

DB Dinesh Babu Yadav Syncfusion Team April 17, 2017 04:19 AM UTC

Hi Prasad, 
 
Thank you for contacting the Syncfusion Support. 
 
We have analyzed the reported issue “Null Reference exception throws while navigating to SfListView main page” with our sample. In the sample, we have navigate the SfListView page in an button click event by using PushAsync method as like below code snippet and PushModalAsync method and also navigate back to the MainPage but we didn’t face any issue as reported in the incident. We have also attached the sample for your reference and you can download it from the below link. 
 
 
Code Snippet[C#]: 
 
Navigation.PushAsync(new MainPage(), true); 
 
 
Could you please check with the above sample?. If the issue still reproduces at your end, please modify the above sample to reproduce the issue and update us with replication procedure and also, could you please share the below details which would help us to analyze the issue better and update you with appropriate solution.  
 
  • Could you please share in which layout the SfListView is loaded?
  • Can you please share the SfListView version and Xamarin Forms version?. We have tested in Xamarin Forms (v 2.3.3.180) and SfListView (v 15.1.0.41).
  • Have you used any specific scenario which replicate the issue? If possible, please replicate the issue in a sample.
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 



DP Devi Prasad April 17, 2017 09:39 AM UTC

But when we put this sflistview in tabbed page app is crashes. 

(My Crash Incident : I placed sf listview in tabbed page, and my page contains three tabs and each tab contains sf listview with items binding when i navigate to detail page from main tabbed page and back to main page the app is crashes..)  


MK Muthu Kumaran Gnanavinayagam Syncfusion Team April 19, 2017 11:20 AM UTC

Hi Prasad, 
 
We have analyzed the reported query “Null Reference exception throws while navigating in TabbedPage” and we are unable to reproduce the issue with our sample. In our sample, we have three tabs and load ListView in each tab. But, we didn’t face any issue while navigating across tabs and you can download the sample from the below link.  
 
 
Could you please check with the above sample? If the issue still reproduces at your end, please modify the above sample to reproduce the issue and update us with replication procedure and also, could you please share the below details which would help us to analyze the issue better and update you with appropriate solution.   
 
·       Could you please share in which layout the SfListView is loaded? 
·       Can you please share the SfListView version and Xamarin Forms version? We have tested in Xamarin Forms (v 2.3.3.180) and SfListView (v 15.1.0.41). 
Please let us know if you require further assistance. 
Regards, 
G.Muthu Kumaran. 



DP Devi Prasad April 21, 2017 09:17 AM UTC

I tried this one can you please download it check it in windows for multiple conditions..

here is my project url i shared it through dropbox.


Thank you,


MK Muthu Kumaran Gnanavinayagam Syncfusion Team April 26, 2017 03:42 AM UTC

Hi Prasad, 
 
We have analyzed the reported query “Null Reference exception throws while navigating in TabbedPage” and we would like to let you know that, the exception raised due to set the same GridLayout instance to LayoutManager of SfListView while navigation from one page to another page. So, you can achieve your requirement by creating separate instances for GridLayout for each ListView like below code snippets, 
 
Code example[C#]: 
protected override void OnSizeAllocated(double width, double height) 
{ 
    base.OnSizeAllocated(width, height); 
    if (width > 0 && pagewith != width) 
    { 
      double size = 0; 
      if (Device.OS == TargetPlatform.iOS && Device.Idiom == TargetIdiom.Tablet) 
      { 
        size = Application.Current.MainPage.Width / 300; 
      } 
      else 
        size = Application.Current.MainPage.Width / 250; 
      var sdf = size.ToString().Split('.')[0]; 
      size = Convert.ToInt32(sdf); 
         
      GridLayout gl = new GridLayout(); 
      GridLayout g2 = new GridLayout(); 
      GridLayout g3 = new GridLayout(); 
 
      gl.SpanCount = (int)size; 
      list1.LayoutManager = gl; 
      g2.SpanCount = (int)size; 
      list2.LayoutManager = g2; 
      g3.SpanCount = (int)size; 
      list3.LayoutManager = g3; 
    } 
} 
  
For your reference, we have attached the working sample below, 
 
 
Please let us know if you require further assistance. 
 
Regards, 
G.Muthu Kumaran. 


Loader.
Live Chat Icon For mobile
Up arrow icon