BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

StringGrid Selection and Scrolling

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
C. W. Smith
Guest





PostPosted: Thu Jan 22, 2004 4:40 pm    Post subject: StringGrid Selection and Scrolling Reply with 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?

Thanks
Back to top
C. W. Smith
Guest





PostPosted: Thu Jan 22, 2004 6:06 pm    Post subject: Re: StringGrid Selection and Scrolling Reply with quote




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





PostPosted: Thu Jan 22, 2004 6:21 pm    Post subject: Re: StringGrid Selection and Scrolling Reply with quote



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





PostPosted: Thu Jan 22, 2004 9:23 pm    Post subject: Re: StringGrid Selection and Scrolling Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.