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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set number of columns in SfListView in SfPopup from xaml

Thread ID:

Created:

Updated:

Platform:

Replies:

147375 Sep 8,2019 03:54 PM UTC Sep 11,2019 05:37 AM UTC Xamarin.Forms 5
loading
Tags: SfPopup
John
Asked On September 8, 2019 03:54 PM UTC

Is it possible to set the number of columns of an SfListView contained within a SfPopup in XAML?  If so how would I do that?

John

Shivagurunathan Kamalakannan [Syncfusion]
Replied On September 9, 2019 01:38 PM UTC

Hi John,   
    
Thanks for contacting Syncfusion support.   
 
Your requirement to have multiple columns in SfListview in Xaml page can be achieved by using layout manager in SfListView. You can use GridLayout so that you can load the items based on the columns. 
 
Refer the following code snippet: 
 
<syncfusion:SfListView x:Name="listView"  
                       ItemSize="50"  
                       ItemsSource="{Binding Items}" > 
 
    <syncfusion:SfListView.LayoutManager> 
        <syncfusion:GridLayout SpanCount="3"/> 
    </syncfusion:SfListView.LayoutManager> 
 
 
 
</syncfusion:SfListView> 
 
 
We have prepared a sample in which SfListView has been loaded inside the SfPopupLayout. And it can be downloaded from the below link. 
 
Please let us  know for further assistance. 
    
Regards,   
Shivagurunathan 


John
Replied On September 9, 2019 02:04 PM UTC

Thank you very much!  How would one use OnIdiom to set different spans based on device?

John

Shivagurunathan Kamalakannan [Syncfusion]
Replied On September 10, 2019 10:53 AM UTC

Hi John,   
   
Thanks for the update.     
   
You could set OnIdiom for the SpanCount property of GridLayout. With OnIdiom you can give the values based on the type of device.   
   
Please refer the below user guideline.   
   
Xaml code snippet:   
   
<syncfusion:SfListView.LayoutManager>   
    <syncfusion:GridLayout>   
        <syncfusion:GridLayout.SpanCount>   
            <OnPlatform x:TypeArguments="x:Int32">   
                <On Platform ="UWP">   
                    <OnIdiom x:TypeArguments="x:Int32"    
                             Phone="2"    
                             Tablet="4"    
                             Desktop="4"/>   
                </On>   
                   
                <On Platform ="Android">   
                    <OnIdiom x:TypeArguments="x:Int32"    
                             Phone="2"    
                             Tablet="4" />   
                </On>   
                   
                <On Platform ="iOS">   
                    <OnIdiom x:TypeArguments="x:Int32"    
                             Phone="2"    
                             Tablet="4" />   
                </On>   
            </OnPlatform>   
        </syncfusion:GridLayout.SpanCount>   
    </syncfusion:GridLayout>   
</syncfusion:SfListView.LayoutManager>   
   
  
   
Please refer the attached sample for more details.   
   
Regards,   
Shivagurunathan   


John
Replied On September 10, 2019 12:45 PM UTC

Thank you it works perfect

Farjana Parveen Ayubb [Syncfusion]
Replied On September 11, 2019 05:37 AM UTC

Hi John, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon