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

SfListView - Add items manually

Thread ID:

Created:

Updated:

Platform:

Replies:

151319 Feb 6,2020 05:36 PM UTC Feb 12,2020 04:38 AM UTC WinForms 6
loading
Tags: SfListView
Niranjan Kumar Gopalan [Syncfusion]
Replied On February 7, 2020 11:24 AM UTC

Hi Fred, 

Thanks for contacting Syncfusion support. 

We have checked your query “Need to know whether gradient panel has property to show shadow border”. Currently we do not have support to meet your requirement and we are checking for work-around to meet your requirement and will update you on 11th February 2020. 

Regards, 
Niranjan Kumar 


Dinis Ferreira
Replied On February 7, 2020 12:02 PM UTC

Hello,
I believe this reply is in the wrong thread.
Thanks

Niranjan Kumar Gopalan [Syncfusion]
Replied On February 7, 2020 12:57 PM UTC

Hi Dinis, 

Sorry for the inconvenience caused. 

We have checked your query “Need to add items in SfListItems manually in code behind without using DataSource”. Currently we do not have this support. So we are validating this request with internal team and will let you know on 11th February 2020. 

Regards, 
Niranjan Kumar 


Niranjan Kumar Gopalan [Syncfusion]
Replied On February 11, 2020 12:00 PM UTC

Hi Dinis, 

Thanks for your patience. 

If your data source is of type ObservableCollection, SfListView will be automatically updated when there is any change in that collection. So, if you want to add an item, you can directly add it to the data source, provided it is of type ObservableCollection.  

C#: 
public partial class Form1 : Form 
    { 
        ObservableCollection<CountryInfo> countryInfoCollection = new ObservableCollection<CountryInfo>(); 
        public Form1() 
        { 
            InitializeComponent(); 
            sfListView1.DataSource = GetDataSource(); 
            sfListView1.DisplayMember = "CountryName"; 
 
            ObservableCollection<CountryInfo> GetDataSource() 
            { 
                countryInfoCollection.Add(new CountryInfo() { CountryName = "China", Continent = "Asia" }); 
                countryInfoCollection.Add(new CountryInfo() { CountryName = "India", Continent = "Asia" }); 
                countryInfoCollection.Add(new CountryInfo() { CountryName = "Japan", Continent = "Asia" }); 
                countryInfoCollection.Add(new CountryInfo() { CountryName = "Malaysia", Continent = "Asia" }); 
                countryInfoCollection.Add(new CountryInfo() { CountryName = "Singapore", Continent = "Asia" }); 
                 
                return countryInfoCollection; 
            } 
 
        } 
       private void button1_Click(object sender, EventArgs e) 
        { 
            countryInfoCollection.Add(new CountryInfo() { CountryName = "NewCountry1", Continent = "Number1" }); 
        } 
    } 


Regards, 
Niranjan Kumar 


Dinis Ferreira
Replied On February 11, 2020 01:00 PM UTC

Thanks.

Niranjan Kumar Gopalan [Syncfusion]
Replied On February 12, 2020 04:38 AM UTC

Hi Dinis,  
 
Thanks for your update. 
 
We are glad to know that the reported query has been resolved at your end. Please let us know if you require further assistance. 
 
Regards, 
Niranjan Kumar Gopalan  


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