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

lisebox with multi column

I would like to have a listbox that shows information in multiple columns, not one column. If possible, please give an example

7 Replies

SP Sangeetha Priya Murugan Syncfusion Team August 12, 2019 09:23 AM UTC

Hi Ebi, 

Thank you for contacting Syncfusion support. 

We have checked your reported requirement and we would like to let you know that currently, we don’t have option for showing data in multiple columns for ListBox control. However, we need the following details to check further.  

1. Please share the detailed description of your requirement with screenshots or video demonstration. 
2. Is there any reason behind for showing the data in multiple columns in ListBox? Is yes, kindly share the details? 
3. Share your exact real time use case scenario of your requirement. 

Could you please check the above details and get back to us with the above requested information, based on that we will check and provide you a better solution quickly. 

Regards, 
Sangeetha M 



ET ebi torabi August 12, 2019 02:53 PM UTC

Because of the large amount of data, it scrolls and is unpleasant to the user. Half of the page width is left blank. But if you have a few columns in the box list, it doesn't scroll and the whole page width is filled


SP Sangeetha Priya Murugan Syncfusion Team August 13, 2019 01:29 PM UTC

Hi Ebi, 
 
Thank you for your update. 
 
We have checked your reported requirement, “To display items in multiple columns rather than in single columns based on width” and it can be achieved with some CSS customization in ListBox as like in the below code example. 
 
CODE SNIPPETS: 
 
 
<EjsListBox Value=@Value DataSource="@Data" TValue="string[]"></EjsListBox> 
 
<style> 
 
.e-listbox-wrapper .e-list-parent { 
    display: flex; 
    flex-wrap: wrap; 
} 
.e-listbox-wrapper .e-list-item { 
    width: 25%; // adjust the width of the list item based on your need. 
} 
 
</style> 
 
@code{ 
    public string[] Value = new string[] { "Hennessey Venom" }; 
    public List<object> Data = new List<object> 
{ 
        new { text = "Hennessey Venom", id = "list-01" }, 
        new { text = "Bugatti Chiron", id = "list-02" }, 
        ..// 
    }; 
} 
 
For your convenience, we have prepared the sample based on our suggestion. Please find the link below. 
 
 
Could you please check the above sample and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 



ET ebi torabi August 13, 2019 06:10 PM UTC

Hi Sangeetha M
Thank you very much. Your support team is great. It works great
But all of the listboxes in a page are displayed  in multiline mode.
If possible, give us an example to display a custom listbox in a multiline mode


SP Sangeetha Priya Murugan Syncfusion Team August 14, 2019 06:46 AM UTC

Hi Ebi, 

Thank you for your update. 

We have checked your reported requirement and it can be achievable in ListBox using CssClass property as like in the below code example. 

CODE SNIPPETS: 

<EjsListBox Value=@Value DataSource="@Data" TValue="string[]" CssClass="e-custom"></EjsListBox> 
 
<style> 
.e-custom .e-list-parent { 
    display: flex; 
    flex-wrap: wrap; 
} 
.e-custom .e-list-item { 
    width: 25%; 
} 
</style> 

For your convenience, we have modified our previously updated sample based on our suggestion. Please find the link below. 


Could you please check the above sample and get back to us, if you need any further assistance on this. 

Regards, 
Sangeetha M 



ET ebi torabi August 14, 2019 08:22 AM UTC

Sangeetha M ,
Unfortunately it's not responsive and doesn't work well in mobile mode.
Please see the attached video

Attachment: multiline_column_responsive_fcb01125.rar


SD Saranya Dhayalan Syncfusion Team August 17, 2019 01:40 AM UTC

 
We have checked your reported issue, we have suggested to use the media query to resolve the listbox mobile mode issue. Please find the below code snippet: 
 
Index.razor 
<EjsListBox Value=@Value DataSource="@Data" TValue="string[]" CssClass="e-custom"> 
            <ListBoxSelectionSettings ShowCheckbox="true"></ListBoxSelectionSettings> 
 </EjsListBox> 
 
 
<style> 
    .e-listbox-wrapper .e-list-parent { 
        display: flex; 
        flex-wrap: wrap; 
    } 
 
    @@media (min-width: 320px) and (max-width:480px) { 
        .e-custom .e-list-item { 
            width: 100%; 
        } 
    } 
 
    @@media (min-width: 480px) and (max-width:780px) { 
        .e-custom .e-list-item { 
            width: 50%; 
        } 
    } 
 
    @@media (min-width: 780px) and (max-width:1920px) { 
        .e-custom .e-list-item { 
            width: 25%; 
        } 
    } 
</style> 
 
 
For your convenience we have prepared a sample. Please find the below sample link: 
 
 
Regards, 
Saranya 


Loader.
Up arrow icon