Forums

Find answers, ask questions, and connect with our
community all around the world.

Feed › Forum › Omnis General Forum › Get value when click on the cell of the grid (windowform)

  • Get value when click on the cell of the grid (windowform)

    Posted by khanh vu on October 16, 2023 at 10:17 am

    Is there a way to obtain the value when clicking on a cell? I want to implement the behavior where clicking on a cell changes the icon value from “checked” to “unchecked” on a Windows Form.

    khanh vu replied 3 years ago 2 Members · 2 Replies
  • 2 Replies
  • Götz Krija

    Member
    October 16, 2023 at 12:09 pm

    Is this a Headed Listbox in a thick-client window? If so, you can probably use the approach mentioned in the technical note: https://www.omnis.net/developers/resources/technotes/tngi0029.jsp

    Something like this should work:

    On evClick
    Calculate hrzPos as (mouseover(kMHorz)-$cobj.$left)+($cobj.$hscroll-1)*8
    Calculate columnWidths as $cobj.$columnwidths
    Repeat
    Calculate colNum as colNum+1
    Calculate colRight as colRight+strtok(‘columnWidths’,”,”)
    Until colRight>hrzPos
    OK message {Value in clicked cell: [iList.[con(‘c’,colNum)]]}

    Götz

  • khanh vu

    Member
    October 17, 2023 at 3:49 am

    thank alot😀

Log in to reply.