Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to hide a row of TableNode? (Read 3993 times)
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
How to hide a row of TableNode?
Apr 1st, 2012 at 11:33pm
Print Post  
I try to hide a row of a TableNode. The Head property of row is true or false. To collapse and to expand a row is not what I need.



Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to hide a row of TableNode?
Reply #1 - Apr 2nd, 2012 at 6:14am
Print Post  
There's no Visible property for rows, but you could set their Height to 0 as a work-around. The Bounds assignment forces links to update their positions after the row height is changed:

Code
Select All
private void diagram_CellClicked(object sender, CellEventArgs e)
{
	// hide the clicked row
	e.Table.Rows[e.Row].Height = 0;
	e.Table.Bounds = e.Table.Bounds;
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: How to hide a row of TableNode?
Reply #2 - Apr 2nd, 2012 at 2:43pm
Print Post  
then how to show a row again? thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to hide a row of TableNode?
Reply #3 - Apr 2nd, 2012 at 4:45pm
Print Post  
If all rows are the same height, you could set table.Rows[n].Height = table.RowHeight. If rows can be of different heights, you will have to store the original row height somewhere, e.g. as a value of some cell's Tag.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: How to hide a row of TableNode?
Reply #4 - Apr 2nd, 2012 at 5:34pm
Print Post  
why need "e.Table.Bounds = e.Table.Bounds;", looks it does nothing
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to hide a row of TableNode?
Reply #5 - Apr 2nd, 2012 at 6:01pm
Print Post  
It's a hack to redraw the table and update link positions, since the row.Height setter doesn't do that. If you are hiding rows before the table is drawn and has links connected to it, you don't need to reset Bounds.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: How to hide a row of TableNode?
Reply #6 - Apr 2nd, 2012 at 7:56pm
Print Post  
In my case, all links connect to table, no row, so is it necessary to set Bounds property?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to hide a row of TableNode?
Reply #7 - Apr 3rd, 2012 at 6:43am
Print Post  
Yes, if there aren't links connected to rows, you can skip that. You might still have to call Invalidate to redraw the table though.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint