| View previous topic :: View next topic |
| Author |
Message |
C. W. Smith Guest
|
Posted: Thu Jan 22, 2004 4:40 pm Post subject: StringGrid Selection and Scrolling |
|
|
I have looked but I cannot seem to find any information on selecting a cell (after it ahs been searched) automatically and highlighting it as well as scrolling to the row where it is. Does anyone have any information that might help with this?
Thanks
|
|
| Back to top |
|
 |
C. W. Smith Guest
|
Posted: Thu Jan 22, 2004 6:06 pm Post subject: Re: StringGrid Selection and Scrolling |
|
|
Hans Galema <dontusethis (AT) dontusethis (DOT) nl> wrote:
| Quote: | C. W. Smith wrote:
Please wrap your lines manually.
Please place all the info in the body of a message.
I have looked but I cannot seem to find any information on selecting a cell (after it ahs been searched) automatically and highlighting it as well as scrolling to the row where it is. Does anyone have any information that might help with this?
What has searching a cell to do with it beeing (de)selected or not?
What is selecting a cell automatically ?
If you want to set the active cell by code just set a value
for TStringGrid Row and TStringGrid Col.
Hans.
|
Sorry about the word wrapping!
What you told me works! What I was talking
about as far as automatic goes, I wanted the program
to select the cell and scroll to it depending on the
parameters the user entered. I didn't want the user
trying to scroll through over 1800 rows to see if they
could find it. It is working now, thanks again!
|
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Thu Jan 22, 2004 6:21 pm Post subject: Re: StringGrid Selection and Scrolling |
|
|
C. W. Smith wrote:
Please wrap your lines manually.
Please place all the info in the body of a message.
| Quote: | I have looked but I cannot seem to find any information on selecting a cell (after it ahs been searched) automatically and highlighting it as well as scrolling to the row where it is. Does anyone have any information that might help with this?
|
What has searching a cell to do with it beeing (de)selected or not?
What is selecting a cell automatically ?
If you want to set the active cell by code just set a value
for TStringGrid Row and TStringGrid Col.
Hans.
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Thu Jan 22, 2004 9:23 pm Post subject: Re: StringGrid Selection and Scrolling |
|
|
"C. W. Smith" <cws (AT) cws-scs (DOT) com> wrote:
| Quote: | What you told me works! [...]
|
I think that it's safe to assume that if you didn't know how
to use the Col and Row properties that you don't know about
the TopRow property as well which means that you'll run into
another problem when the desired cell falls outside of visible
range.
To get the row to display when it's not in the visible range:
int MyRow = SearchTheGrid( SomeValue );
if( (MyRow < StringGrid1->TopRow) || (MyRow > (StringGrid1->TopRow + StringGrid1->VisibleRowCount - 1)) )
{
StringGrid1->TopRow = MyRow;
}
~ JD
|
|
| Back to top |
|
 |
|