Plex 2E

 View Only
Expand all | Collapse all

Know at Run time which Cell in a grid is selected

  • 1.  Know at Run time which Cell in a grid is selected

    Posted Apr 02, 2009 11:12 PM
    Good Day
    Can anyone maybe help me. Is it possible, and if it is how, can I determine in a grid which cell is selected to do a drill down on?


  • 2.  Re: Know at Run time which Cell in a grid is selected

    Posted Apr 03, 2009 03:56 AM
    Hi TienieAs long I remember, it ´s possible for a editable grid. Given that, you can make a loop on grid rows, and ask for cell that has focus:For each row GridPget GridPif focus My_data...  


  • 3.  Re: Know at Run time which Cell in a grid is selected

    Posted Apr 06, 2009 05:17 AM
    Hmm.. ok.. I did basically the same, but I used For Each Selected, I just want to know in that row which cel is selected. I suppose it does not make a difference, I might as well jsut use for each row.. I will give it a shot. Thanks!    


  • 4.  Re: Know at Run time which Cell in a grid is selected

    Posted Apr 06, 2009 05:22 AM
    I Tried using what you said, still now luck.. The grid is editable but it does not seem to recognize a focussed cel?


  • 5.  Re: Know at Run time which Cell in a grid is selected

    Posted Apr 06, 2009 06:53 AM
    Tienie, One thing to watch out for is that the editable grid has two "levels" of focus. You click once to focus on the cell but then have to click again to actually focus on the underlying field. It may be that If Focus doesn't work unless the underlying field has focus?


  • 6.  Re: Know at Run time which Cell in a grid is selected

    Posted Apr 08, 2009 04:40 AM
    Hi  I just realised that. That I have to Click, and click again to select the data in the cel, then it picks up the focus. .Thanks for the help. The problem that I have is that I want to do this in a "read Only" grid.. I do not want this specific grid to be editable.. But users should be able to drill down on a cell to see the orders behind that specific cell..  any ideas?


  • 7.  Re: Know at Run time which Cell in a grid is selected

    Posted Apr 08, 2009 05:56 AM
    Hi Tienie,  I didn't verify that by myself, but I think the behaviour of the grid could be different if you set the  grid itself  to Read Only Mode vs you set the fields in the grid to Read Only Mode or if you set the fields in the grid to state Protected at runtime.You may want to try that....      


  • 8.  RE: Re: Know at Run time which Cell in a grid is selected

    Posted Jul 24, 2012 10:02 AM
    Hi Tienie,

    I wonder if you found a solution to this problem as I am facing the same issue now, working in Plex61, tried all kinds of tricks but to no avail.....

    Thanks,

    Simon


  • 9.  RE: Re: Know at Run time which Cell in a grid is selected

    Posted Jul 26, 2012 06:41 AM
    Hi Simon

    Are you also trying to do it with a read only grid?

    I never got a way to get the focus of a cell if the grid is read only. But like I mention we can do it on a editable grid, but you have to click twice on the cell. Once to focus on the cell, and then again to select the data in the cell.. Then we could get the focus


  • 10.  RE: Re: Know at Run time which Cell in a grid is selected

    Posted Oct 08, 2012 06:32 AM
    Hi Tienie,

    Thanks for the reply. My grid is editable but some of the colums are "protected" but still can be selected by the user but not "twice", so works on the editable columns but need it to work on the protected columns too in order to disable an event, wiil give the solutions as mentioned by George a closer look.

    Simon


  • 11.  RE: Re: Know at Run time which Cell in a grid is selected

    Posted Jul 28, 2012 03:42 PM
      |   view attached
    hi Simon the following looks interesting?


  • 12.  RE: Re: Know at Run time which Cell in a grid is selected

    Posted Oct 08, 2012 08:38 AM
    hi George,

    Holidays are over, mine too...

    Thanks for the suggestion.

    Just incoprporated following C source:

    HWND hWnd = ObPanelAPI::GetControlHandleByName( &(3:) );
    LONG lMarker = SendMessage(hWnd, HGM_GETMARKER, 0, 0L);
    &(1:) = HIWORD(lMarker);
    &(2:) = LOWORD(lMarker);

    Where &3: is the control name as on teh panel and &1-2: are numeric indexes.

    This gives me the row and column indexes of the selected cell in the grid. Just need to convince the user not to sort the grid or change the columns around....

    Would be so nice if I could also get the column name!

    Cheers,

    Simon


  • 13.  RE: Re: Know at Run time which Cell in a grid is selected

    Posted Oct 08, 2012 10:23 AM


  • 14.  RE: Know at Run time which Cell in a grid is selected

    Posted Jul 26, 2012 07:22 AM
    Hi Simon

    Anything of any use in widgets help file... Sorry on holiday ... Can't really investigate.... Plex not supported on the iPad yet...
    http://wiki.plexinfo.net/index.php?title=WinWidgets

    Cheers
    George