1
Hello,
You have to subtract one from the count, because 0 to 19 = 20 counts
string[] ItemArray = new string[20];
for (int i = 0; i <= listBox1.SelectedItems.Count - 1; i++)
{
txtmessage.Text = ((DataRowView)listBox1.SelectedItem).Row.ItemArray[i].ToString();
}
Thanks,
Bryian Tan
Accepted 1
Hi Bryian,
Your answer is good...
But
listBox1.SelectedItems.Count is < 5
and also I am geting error..
Thanks
Anish
0
Anish,
What is the relationship between the listbox1, ItemArray and the DataView?