Single selection checkbox

Hello,


I have a dialog with a list of some companies. I have to choose only one. How can I persist single selection type just like I can do it in the grid using:  <GridSelectionSettingsType="Syncfusion.Blazor.Grids.SelectionType.Multiple"></GridSelectionSettings>

My dialog code look like this:

    <SfDialog @bind-Visible="@IsVisible" ShowCloseIcon="true" Width="400" IsModal="true">

        <DialogTemplates>

            <Header>Choose Company to issue an invoice</Header>

            <Content>

                <SfListView @ref="@sfList" DataSource="@relatedCompanies" ShowCheckBox="true" >

                    <ListViewFieldSettings TValue="RelatedCompany" Id="Id" Text="Company.Name"></ListViewFieldSettings>

                </SfListView>

            </Content>

        </DialogTemplates>

        <DialogButtons>

            <DialogButton Content="Submit" IsPrimary="true" @onclick="@OnSelect" />

            <DialogButton Content="Cancel" OnClick="@Cancel" />

        </DialogButtons>

    </SfDialog>


With best regards

Jarosław Bolejko


1 Reply

KR Keerthana Rajendran Syncfusion Team December 27, 2021 11:37 AM UTC

Hi Jaroslaw, 
 
Thanks for contacting Syncfusion support. 
 
ListView is used for displaying the list items and we will not maintain the single selection in ListView component. When streamline this component to Blazor standard in 2020 Volume 3 release(18.3.35), we have deprecated all the selection related methods(GetSelectedItems, selectItem and SelectMultipleItems).   
 
Refer to the below release notes.     
      
       
We can maintain the selection only by enabling the ShowCheckBox property of ListView component.  
 
We have a similar component ListBox which contains selection settings option as like Grid.  
 
Refer to the below UG link for more details on ListBox component.  
 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Keerthana R. 


Loader.
Up arrow icon