TheSwamp

Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: It's Alive! on June 05, 2007, 01:58:30 PM

Title: Grid control Method SelCurRow Bug?
Post by: It's Alive! 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
Title: Re: Grid control Method SelCurRow Bug?
Post by: Kerry on June 05, 2007, 05:38:05 PM

Dan, Can you post this as a bug at Sourceforge ( with a sample ODC and LSP )
Title: Re: Grid control Method SelCurRow Bug?
Post by: It's Alive! 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
Title: Re: Grid control Method SelCurRow Bug?
Post by: Kerry 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 :-)
Title: Re: Grid control Method SelCurRow Bug?
Post by: It's Alive! 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
Title: Re: Grid control Method SelCurRow Bug?
Post by: Kerry 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.