|
-
May 26th, 2009, 01:45 AM
#1
[RESOLVED] Get data from DataGridView
Hello everyone.I have a problem with reading data from DataGridView to array. Use code:
int[,] n = new int[3,19];
for (int i = 1; i <= StartDataView.Rows.Count; i++)
{
for (int j = 1; j <= StartDataView.Columns.Count; j++)
{
n[i - 1, j - 1] = (int)StartDataView.Rows[i].Cells[j].Value;
}
}
but all values results is "null";in this case:
n[i - 1, j - 1] = int.Parse(StartDataView.Rows[i].Cells[j].Value.ToString());
get "0";
What I do wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|