Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Tablenode visible rows (Read 2543 times)
kc13
YaBB Newbies
*
Offline



Posts: 29
Joined: Jan 19th, 2009
Tablenode visible rows
Sep 3rd, 2009 at 10:44pm
Print Post  
How can I determine (in code) the number of visible rows in a tablenode?  Or, how do I know if the current highlighted row is visible?

i don't want to always set the CurrentScrollRow to the HighlightedRow...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tablenode visible rows
Reply #1 - Sep 4th, 2009 at 2:46pm
Print Post  
If all rows are the same height, you can find the number of visible rows like this:

int visibleRows = (t.Bounds.Height - t.CaptionHeight) / t.RowHeight;

Another possibility is to call CellFromPoint for some point a few pixels above table.Bounds.Bottom and check the returned row value.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tablenode visible rows
Reply #2 - Sep 4th, 2009 at 2:53pm
Print Post  
Another option, if you have the index of some row, you could call (table[0,row] as InplaceEditable).GetEditRect() and check if the returned rectangle's Y is between the table's top and bottom coordinates.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
kc13
YaBB Newbies
*
Offline



Posts: 29
Joined: Jan 19th, 2009
Re: Tablenode visible rows
Reply #3 - Sep 7th, 2009 at 1:26pm
Print Post  
Thanks, I'll give these suggestions a try.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint