This example adds the contents of a Windows Forms TextBox control to a ListBox control when you click button1, and clears the contents when you click button2.
Example 1:
private void button1_Click(object sender, System.EventArgs e)
{
listBox1.Items.Add("Sally");
listBox1.Items.Add("Craig");
}
private void button2_Click(object sender, System.EventArgs e)
{
listBox1.Items.Clear();
}
Is this Work When the list is bonded with data source?
ReplyDeleteYes it will work if list bonded with data source or manually data filed.
ReplyDelete