working with grid
-
i'm making a program to read data from file and display it. i tried to insert the activeX control "microsoft datagrid control 6.0" to display data. but how do i access each cell of grid to assign member variable to update data onto the grid? or what address of each cell?
-
i'm making a program to read data from file and display it. i tried to insert the activeX control "microsoft datagrid control 6.0" to display data. but how do i access each cell of grid to assign member variable to update data onto the grid? or what address of each cell?
catngo wrote: i tried to insert the activeX control "microsoft datagrid control 6.0" You mean the Microsoft FlexGrid Control? If yes, you can set text into a cell using the
SetTextArray(long index, LPCTSTR lpszNewValue)
funtion. Cell index start from 0 and it goes from left to rigt (and then to the next line). Hope this helps. -
catngo wrote: i tried to insert the activeX control "microsoft datagrid control 6.0" You mean the Microsoft FlexGrid Control? If yes, you can set text into a cell using the
SetTextArray(long index, LPCTSTR lpszNewValue)
funtion. Cell index start from 0 and it goes from left to rigt (and then to the next line). Hope this helps. -
catngo wrote: i tried to insert the activeX control "microsoft datagrid control 6.0" You mean the Microsoft FlexGrid Control? If yes, you can set text into a cell using the
SetTextArray(long index, LPCTSTR lpszNewValue)
funtion. Cell index start from 0 and it goes from left to rigt (and then to the next line). Hope this helps. -
sorry, i'm a noob here. can you be more detail on this? okay, let say i want "mom" in cell B2. how the code goes?
Ok. In quick, here is a picture of the indexes of the cells (for a 3X3 grid):
Col A Col B Col C
Row0 0 1 2
Row1 3 4 5
Row2 6 7 8So, if you want to put "mom" in cell B2, you'll have to write:
m_Grid.SetTextArray(6,"mom");
6 is given by: RowIndex * Number of column + ColIndex (In your case: RowIndex=2, ColIndex=0) -
sorry, i'm a noob here. can you be more detail on this? okay, let say i want "mom" in cell B2. how the code goes?
-
Okay, this what i use: CMSFlexGrid FlexGrid; FlexGrid.SetTextArray(2,"mom"); got an "assertion failed" error.
-
got it, thank you much. i was trying to access the class function instead of variable member control. that how i got the error msg, it work now.