473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dataGridView1 column separator help...

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

May 30 '07 #1
1 2042
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"trint" <tr***********@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
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

May 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jim Geissman | last post by:
I am trying to bulk insert a text file. The file has fixed-length fields with no field terminators. BOL says that field terminators are only needed when the data does *not* contain fixed-length...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
2
by: DC | last post by:
Hi all, is there any short way to accomplish column "auto"-sizing in a Datagrid? (Something like double-clicking column header separator) I suppose datagrid object calls some kind of "internal"...
1
by: Jose | last post by:
Please how shows the vertical column separator line in a datagrid? Thanks a lot
1
by: laredotornado | last post by:
Hi, I'm using php 4.4.4. I have a CSV file that contains columns "A" and "B". What is the simplest way to create a second CSV file with the values of column "A" copied into column "B"? The...
1
by: trint | last post by:
Hi, I have dataGridView1 with a DataSource (categoriesBindingSource). I didn't use the vs.net workbench to bind the second datagridview (dataGridView2). I used this code: ...
1
by: hughwarrington | last post by:
Hi there, I'd like to detect when the user resizes a column on a DataGridView by dragging the separator situated between columns. There is the ColumnWidthChanged event, but I can't find a way of...
2
by: Andrus | last post by:
VSE 2005 .NET 2 WinForms I have DataGridView in virtual mode containing huge number of rows. When user double clicks in column separator line in grid header, application hangs: grid tries to...
0
by: =?Utf-8?B?UGF1bCBT?= | last post by:
Hi I want to make a 2-column list of historical data grouped by date. Each group of data must have a separator that spans over both columns. I have tried to do it with a datalist but the separator...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.