i'm trying to add list data object with list control two time.
1)first click on button when in list box there is no items [if block content]
2)second click onwards [else bock content]
problem is on second click data loading in list data object successfully but not displayed in list box.
public partial class Form11 : Form
{
List<string> str = new List<string>();
public Form11()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (listBox1.Items.Count == 0)
{
str.Add("A");
str.Add("B");
}
else
{
str.Add("C");
}
listBox1.DataSource = str;
}
}