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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is it possible to have more than 1 sf list view in a content page?

Thread ID:

Created:

Updated:

Platform:

Replies:

128899 Feb 14,2017 09:57 PM UTC Feb 22,2017 04:05 PM UTC Xamarin.Forms 5
loading
Tags: SfListView
darrell breyer
Asked On February 14, 2017 09:57 PM UTC

In the sample code examplesContentPage.BindingContext is always used and is pointed to a single ViewModel. I would like to have 2 totally separate sf list views on the same content page that look to totally different view models. In xamarin you can populate itemssource in the code behind. Is this possible using sync fusion? 2 lists would allow me to clearly separate the two in the UI. The 2 lists also will have items added and removed.
Any suggestions or code samples would be greatly appreciated...

Dinesh Babu Yadav [Syncfusion]
Replied On February 15, 2017 06:57 PM UTC

Hi Darrell, 
 
Thank you for using Syncfusion products. 
 
We have prepared a sample based on your requirement “Two SfListView in a ContentPage”, which illustrates to define the multiple SfListView in a content page with different view models. And also you can add and remove the items in each SfListView. You can download the sample from the below link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 


darrell breyer
Replied On February 16, 2017 01:57 PM UTC

Thank you for your response.  I will give it a try and let you know if I have any questions....

Dinesh Babu Yadav [Syncfusion]
Replied On February 17, 2017 09:57 AM UTC

Hi Darrell, 
 
Thanks for the update. 
 
Regards, 
Dinesh Babu Yadav 


darrell breyer
Replied On February 21, 2017 04:18 PM UTC

Hi Dinesh,

Thanks you for providing the answer via sample code.  It's very helpful.  I implemented the code and am able to see the 2 views nicely.  However I noticed the content of the view is contained in a fixed height, and to see all the list data  I have to scroll.  Is it possible to show the full list?  Each list will only be a few items.  I need the list area to grow in size as items are added to the list without adding a scrollbar.  

Sorry if this is confusing...

D

Dinesh Babu Yadav [Syncfusion]
Replied On February 22, 2017 04:05 PM UTC

Hi Darrell, 
 
SfListView doesn’t provide support for your requirement due to restrictions in Xamarin Forms layout. By default, in Xamarin Forms any view will be arranged with maximum value of allocated size and available size.  
 
Allocated size – size allocated by the parent to render its child. 
Available size – size calculated by the child to render itself. 
 
However, you can achieve your requirement in the sample level by modifying the HeightRequest value of the SfListView based on your items’ height. This is just a workaround and is not guaranteed to work on complex layouts in Xamarin.  
 
We have prepared a sample to meet your requirement and you can download the same from the below location. 
 
 
Regarding your query, “I need the list area to grow in size as items are added to the list without adding a scrollbar”. 
When the underlying data in SfListView exceeds the view area, the scrollbar will be automatically enabled to represent that the list view items are scrollable. This is the actual behavior of a ListView and cannot be changed.  
 
Regards, 
Dinesh Babu Yadav 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;