how to change data in row x, col y in datagrid MASM32?

Started by elmo, October 21, 2010, 06:47:32 AM

Previous topic - Next topic

elmo

I create 1 datagrid, 1 button
it datagrid have 5 row, 5 column

         col0    col1    col2     col3     col4
row0
row1
row2
row3
row4


example: If I click that button, I want change data in col 3 row 2 to become X


         col0    col1    col2     col3     col4
row0   
row1
row2                                  X 
row3
row4


That code only like this:
;change data in col 3, row 2
invoke SendMessage,hGrid,GM_SETCURSEL,(2 shl 16) or 3,0
invoke SendMessage,hGrid,GM_SETCELLDATA,(2 shl 16) or 3,SADD("X")


Now I want to do looping to change data in col 3, row 0 until row 4
I have create code below:

mov esi,0
.while esi<6
     ;change data in col 3, row 2
     invoke SendMessage,hGrid,GM_SETCURSEL,(esi shl 16) or 3,0
    invoke SendMessage,hGrid,GM_SETCELLDATA,(esi shl 16) or 3,SADD("X")
    add esi,1
.endw

so, the datagrid will be

         col0    col1    col2     col3     col4
row0                                X 
row1                                X
row2                                X 
row3                                X
row4                                X


But it doesn't work.










Oh yeah, I am still have problems who not get the answer:
http://www.masm32.com/board/index.php?topic=15113.0
http://www.masm32.com/board/index.php?topic=15114.0
http://www.masm32.com/board/index.php?topic=15123.0






Could you help me to solve this problems?
Thank you

Fritz Gamaliel



be the king of accounting programmer world!