|
빌더의 도움말을 보면 아래와 같습니다.
Lists the strings for each cell in the grid.
__property AnsiString Cells[int ACol][int ARow] = {read=GetCells, write=SetCells};
Description
Use Cells to access the string within a particular cell. ACol is the column coordinate of the cell, and ARow is the row coordinate of the cell. The first row is row zero, and the first column is column zero.
The ColCount and RowCount property values define the size of the array of strings.
----------------------------------------------------------------------------------
To access the objects associated with the strings in the Cells array, use the Objects property.
그리드에서 안보이는건 완전 소스가 아니라서 다른 문제일 수도 있습니다만, 예전 제 경험에 의하면 위에서 밑줄친 부분 문제때문에 안보인적이 있었습니다. 그리드의 프로퍼티에서 ColCount는 2로, RowCount는 19로 지정해 준 다음 돌려보시는게 어떻겟습니까? 그렇게 해도 안보이면 다른 여기 소스에 나온부분이 아닌 다른문제로 안보이는겁니다.
추가로 Cells index역시 윗글에 있듯이 0부터 시작합니다. 타이틀을 넣기위해 의도적으로 +1증가된 값으로 Access하는걸로 이해했습니다만?
박보연 님이 쓰신 글 :
: 답변 감사드립니다.
:
: 답변해주신대로 아래처럼 바꿨습니다.
: //---------------------------------------------------------------------------
: void TForm1::Write(Byte *ch, long len)
: {
: int i;
: float f;
: AnsiString tmp[18];
:
: if(Count>=1 && Count<=18)
: {
: f = atof(ch);
: tmp[Count-1] = FormatFloat("0.0000", f);
:
: if(Count==18)
: {
: for(i=1; i<=18; i++)
: StringGrid1 -> Cells[1][i] = tmp[i-1];
:
: Count = 0;
: }
: }
: }
: //---------------------------------------------------------------------------
:
:
: 그런데요..
: 실행은 아무 이상 없이 잘 되는데,
: 스트링그리드에 아무 값도 나타나지 않습니다.
:
: 어떻게 해야할지...
:
: 답변 부탁드립니다~
:
:
|