Forums - C# Corner

Forum guidelines
John Doe

John Doe

  • 0
  • 7
  • 0

Get data from DataGridView

May 25 2009 8:03 AM
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",I tried Value.ToString(),but also no result.What I do wrong?

Answers (7)

Visual Studio Live - Redmond 2016

SPONSORED BY

File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!