Recent

Author Topic: Problem with selected row in Tstringgrid  (Read 394 times)

jeremzw

  • Newbie
  • Posts: 3
Problem with selected row in Tstringgrid
« on: May 22, 2020, 12:25:29 pm »
Hello,

I'm having a problem with the row selection in tstringrid :
My grid is on goRowSelect (single row mode).

After selecting a row for the first time, moving the mouse over the stringgrid automatically select another row (the one the mouse is over), as a kind of magnetic effect, until I click another row.
Then, clicking a third row will start the same effect again, until I click a 4th row, and so on...

Is there a way to completely get rid of the rows being selected by just moving the mouse ?
I can't find the option in the object inspector...

Thanks

jamie

  • Hero Member
  • *****
  • Posts: 3541
Re: Problem with selected row in Tstringgrid
« Reply #1 on: May 22, 2020, 01:05:38 pm »
turn goRangeSelect  off ?
The only true wisdom is knowing you know nothing

jeremzw

  • Newbie
  • Posts: 3
Re: Problem with selected row in Tstringgrid
« Reply #2 on: May 22, 2020, 01:30:48 pm »
It's already at false...

wp

  • Hero Member
  • *****
  • Posts: 7553
Re: Problem with selected row in Tstringgrid
« Reply #3 on: May 22, 2020, 01:43:19 pm »
I don't know, there are so many options...

For a test, drop another StringGrid on the form, and compare which values in the Options are different. Reset the Options of your probematic grid to those of the temp grid. Does the issue go away?

Another possibility: Is there a handler for OnPrepareCanvas or OnDrawCell? Their code could reult in the same effect.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

jeremzw

  • Newbie
  • Posts: 3
Re: Problem with selected row in Tstringgrid
« Reply #4 on: May 22, 2020, 02:11:12 pm »
Thanks, I did your test, but I couldn't find any specific options that could be wrong...
Here's a capture of the object inspector.

No handler. There's only one event onselection.

jamie

  • Hero Member
  • *****
  • Posts: 3541
Re: Problem with selected row in Tstringgrid
« Reply #5 on: May 22, 2020, 04:46:26 pm »
seems to be different here. I turn off rangeSelect and I only get one row, It does not expand to more rows if you drag the mouse.

 if you are getting this without dragging the mouse then you have some other issue do doubt.

 What target widget are you on ? I did this on Windblows


The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018