C# ArrayList Display in Richtextbox
How would I write the code, so that when the user selects Apples from the comboBox the data that I have stored in my arraylist that relates to apples will show in the richtextbox?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 26, 2010, 9:18 PM EST
as i understood i think you want something like this:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedItem == "XYZ")
{
for (int i = 0; i < myData.Count; i++)
{
richTextBox1.Text += myData[i] + Environment.NewLine;
}
}
}
Don't forget to mark the answer if it helps.