Author Topic: Grid control Method SelCurRow Bug?  (Read 4491 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8712
  • AKA Daniel
Grid control Method SelCurRow Bug?
« on: June 05, 2007, 01:58:30 PM »
This method will force an entire row to be selected and will also scroll the Grid to ensure the row is visible.
Pass in a -1 if you wish to deselect the current selection. 

But the "scroll the Grid to ensure the row is visible" part doesn’t want to work for me

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Grid control Method SelCurRow Bug?
« Reply #1 on: June 05, 2007, 05:38:05 PM »

Dan, Can you post this as a bug at Sourceforge ( with a sample ODC and LSP )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8712
  • AKA Daniel
Re: Grid control Method SelCurRow Bug?
« Reply #2 on: June 05, 2007, 10:36:06 PM »

Dan, Can you post this as a bug at Sourceforge ( with a sample ODC and LSP )

I can do that  :-)
Thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Grid control Method SelCurRow Bug?
« Reply #3 on: June 05, 2007, 11:31:14 PM »
Daniel,

I added a button and defined an Event Handler ;
Note that I've used the row as (GetRowCount less 1)

Code: [Select]
(DEFUN c:DwgProp_FormDwp_SelectCurrentRow_OnClicked (/)
  (ALERT (ITOA (ODCL_GRID_GETROWCOUNT DwgProp_FormDwp_GridProp)))
  (ODCL_GRID_SELCURROW
    DwgProp_FormDwp_GridProp
    (- (ODCL_GRID_GETROWCOUNT DwgProp_FormDwp_GridProp) 1)
  )
)

.. and changing the offending line in c:DwgProp_FormDwp_ButtonAddItem_OnClicked seems to work
Code: [Select]
      ;;(ODCL_GRID_SELCURROW DwgProp_FormDwp_GridProp (1+ nRow))
                                                       ;<- Bug? <<<<<<<<
      (ODCL_GRID_SELCURROW DwgProp_FormDwp_GridProp nRow)


added:
So the issue is that the row count is Zero based , { I think }

PS added:
BTW, nice code :-)
« Last Edit: June 05, 2007, 11:37:47 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8712
  • AKA Daniel
Re: Grid control Method SelCurRow Bug?
« Reply #4 on: June 05, 2007, 11:44:38 PM »
That fixed it. So it wasn’t a bug , but my lack of ODCL knowledge and a lack of good coffee

Thanks a ton Kerry

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Grid control Method SelCurRow Bug?
« Reply #5 on: June 05, 2007, 11:47:49 PM »
No Worries :-) you're welcome.


I'll add a note to the Report that it's resolved and point back here.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.