Use a
List<yourobjecttype></yourobjecttype>
to store the data and set this as the datasource of the datagridview
Something like this
List<yourobjecttype> items = new List<yourobjecttype>();
DataGridView grid = new DataGridView();
private void ListBoxIndexChanged(..)
{
items.AppendRange(GetData());
grid.DataSource = items;
}
private List<yourobjecttype> GetData()
{
List<yourobjecttype> data = new List<yourobjecttype>();
return data ;
}</yourobjecttype></yourobjecttype></yourobjecttype></yourobjecttype></yourobjecttype>