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

ListView with switch/checkbox

Thread ID:

Created:

Updated:

Platform:

Replies:

127371 Nov 10,2016 01:25 PM UTC Nov 11,2016 07:29 AM UTC Xamarin.Forms 2
loading
Tags: SfDataGrid
Stratis Batikas
Asked On November 10, 2016 01:25 PM UTC

Is it possible to have only 2 columns with text and switch (ios) / checkbox(droid&wf). Lets say a list of fruits on the left column and the buttons or the right column! like you have here https://help.syncfusion.com/xamarin/sfdatagrid/overview. Are the selection events work with the btns and if yes can I have multiple selections? Thanks

Stratis Batikas
Replied On November 10, 2016 01:28 PM UTC

Something similar to that https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/multiselect/ but using the syncfusion!

Divakar Subramaniam [Syncfusion]
Replied On November 11, 2016 07:29 AM UTC

Hi Stratis, 
 
 
Thanks for contacting Syncfusion Support. 
 
 
In SfDataGrid, it is possible to achieve your requirement. You can enable multiple selection in SfDataGrid by setting SfDataGrid.SelectionMode as “Multiple”. 
 
<syncfusion:SfDataGrid x:Name="dataGrid" 
                       AutoGenerateColumns="False" 
                       ColumnSizer="Star" 
                       ItemsSource="{Binding OrdersInfo}" 
                       SelectionMode="Multiple"> 
 
 
If you need to apply the selection for the column having button, then it is possible by loading button in the center and leave the space to the left and right of the button instead of loading the button to the cell size. Please refer the below code snippet for better understand. 
 
<syncfusion:GridTemplateColumn MappingName="Fruits"> 
    <syncfusion:GridTemplateColumn.CellTemplate> 
        <DataTemplate> 
            <Grid> 
                <Grid.ColumnDefinitions> 
                    <ColumnDefinition Width="*" /> 
                    <ColumnDefinition Width="Auto" /> 
                    <ColumnDefinition Width="*" /> 
                 </Grid.ColumnDefinitions> 
                 <Button Grid.Column="1" Text="{Binding Fruits}" /> 
             </Grid> 
         </DataTemplate> 
     </syncfusion:GridTemplateColumn.CellTemplate> 
</syncfusion:GridTemplateColumn> 
 
 
We have prepared a sample based on your requirement by loaded the buttons in one column and loaded checkbox in one column and you can download the same from the below link. 
 
 
 
 
Regards, 
Divakar. 


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

;