dataGridView1 column separator help...

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

Hi,
I have a dataGrid that when I try to add a row, I can't keep the data
separated into columns.
Here is what I tried to separate the columns (a coma):

string[] completeProductsString = new string[1000];
DataGridViewRowCollection rows = this.dataGridView1.Rows;
completeProductsString[j1] = productsString0[j1] + "," +
productsString1[j1];
rows.Add(completeProductsString[j1]);

Any help is appreciated.
Thanks,
Trint
 
Trint,

You shouldn't be using a comma delimited string. You are just passing a
single string, and that's why you are getting one value in your data set.

Rather, if you have five columns in your table, then your array that you
pass to the Add method should have five elements in it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top