Hi
I'm reading a TXTfile andI want toadd data to the cells in aDataGridViewnamedGrillaDatos.
To add the dataI do the following:
GrillaDatos[0, GrillaDatos.RowCount - 1].Value =Convert.ToString(GrillaDatos[0, GrillaDatos.RowCount - 1].Value) +Convert.ToChar(Valor);
Whereinitially GrillaDatos.RowCountinitiallyequals 1.
AndValor
is a variable oftypeushort.
This part of thecode worksOK, add
bytesto the cell.
When Iwant to adda new column, we performthe following:
GrillaDatos.RowCount++;
WhenI return to my routineinvokeexplainedat the beginning, I discoveredthat the value inthe previous rowdisappears andvalues beforethe new rowis added.
For example, suppose that inthe beginningGrillaDatos.RowCount= 1;
I adddatato the first row:
GrillaDatos[0, GrillaDatos.RowCount-1].Value = “Hello”
This means that:
GrillaDatos[0, 0].Value = “Hello”
Then Iincrease a row:
GrillaDatos.RowCount++;
Now I addinformation to thenew row:
GrillaDatos[0, GrillaDatos.RowCount-1].Value = “Bye”
But whenI check the statusof the cellsof the objectI getthe following:
GrillaDatos[0, 0].Value = null
GrillaDatos[0, 1].Value = “HelloBye”
Any suggestions?
Thanks in advance