Error while displaying 2 dimentional data in data grid
-
I am getting error when I do following. string[,] myArray = new string[2,2]; myArray[0,0] = "elad"; myArray[0,1] = "3"; myArray[1,0] = "david"; myArray[1,1] = "5"; grd.DataSource = myArray; grd.DataBind();
thanks
What error? Compile error? Did your app crash? Did it screw your hard disk? Kick your dog? Steal your girlfriend? How are people supposed to help you if you don't tell them what's wrong in the first place?
Cheers, Vıkram.
Carpe Diem.
-
What error? Compile error? Did your app crash? Did it screw your hard disk? Kick your dog? Steal your girlfriend? How are people supposed to help you if you don't tell them what's wrong in the first place?
Cheers, Vıkram.
Carpe Diem.
-
There you have it!!! Your array is jagged (multidimensional), but the grid expects a single dimensional array. Create a struct or a class with public properties for the grid's columns. Create an array of this type to represent the rows, and use that array as the data source.
Cheers, Vıkram.
Carpe Diem.
-
There you have it!!! Your array is jagged (multidimensional), but the grid expects a single dimensional array. Create a struct or a class with public properties for the grid's columns. Create an array of this type to represent the rows, and use that array as the data source.
Cheers, Vıkram.
Carpe Diem.