Results 1 to 7 of 7

Thread: cCJGrid Behaviour

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default cCJGrid Behaviour

    I am doing something a little unorthodox with a cCJGrid to meet a customer requirement.

    They want to be able to enter quantities of Order Items for a given Product. An Item is a specific Product, in a given Colour and in a given Size, so they select a Product and on clicking a prompt button I bring up a modal dialog which has a cCJGrid in it. In that grid, in the LoadData procedure, I first check that the COM object has been created and if not I send CreateComObject. Next I send DestroyColumnObjects to ensure there are none (there really shouldn't be at that point). Then I Get CreateNamed of a cCJGridColumn object to hold the Colour names, after which I Get CreateNamed of cCJGridColumns for each of the Sizes that exist for that product (I'm using SQL calls to gather that data). Finally I populate the Grid with rows for each of the Colours that exist for that product. If a given Colour/Size comination is unavailable I colour it clFuchsia in OnSetDisplayMetrics in that sub-class.

    Click image for larger version. 

Name:	Screenshot 2022-11-25 at 11.17.15.jpg 
Views:	90 
Size:	251.3 KB 
ID:	15788

    Now additionally the users want to be able to navigate using the keyboard (specifically the arrow keys, so I've just had kRightArrow send Next and kLeftArrow send Previous).

    However I want to disable entry in those "unavailable" cells.

    Mostly I've been trying this in OnSetDisplayMetrics in the sub-class, but I've also tried in OnEntering - correction: OnEnter:

    Setting pbEditable or pbFocusable screws up keyboard navigation.

    Setiing pbReadOnly causes any entered data to be cleared on navigating out of the row (by pretty much any mechanism).

    Anybody know (or have any suggestions) how to solve this?

    Mike
    Last edited by Mike Peat; 25-Nov-2022 at 12:18 PM. Reason: OnEnter not OnEntering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •