Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to expand table header row in code? (Read 3484 times)
bradaisa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Sep 9th, 2009
How to expand table header row in code?
Sep 15th, 2009 at 5:03pm
Print Post  
I have a diagram with quite a few tables that each have a Header row then a bunch of table rows; I initially draw it with the tables collapsed, but then I want to expand the table header in code -- I thought I could do this:

Code
Select All
            Dim tn As TableNode = CType(node, TableNode)
            For Each row As TableNode.Row In tn.Rows
                If row.Header AndAlso (Not row.Expanded) Then
                    row.Expanded = True
                End If
            Next 



But nothing seems to happen, -- i checked in the debugger that the row.Expanded line is being hit, but in the GUI, the tables stay with their rows unexpanded. Can someone help?
  
Back to top
 
IP Logged
 
bradaisa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Sep 9th, 2009
Re: How to expand table header row in code?
Reply #1 - Sep 15th, 2009 at 5:39pm
Print Post  
Update: I notice that my table headers that are affected actually have the - indicator, not the + indicator, seeming to indicate they are expanded -- also, if you click the - it does nothing, but goes + then if you click the + it expands -- so there seems to be a disconnect -- part of the code thinks the rows are expanded, but they don't actually expand
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to expand table header row in code?
Reply #2 - Sep 15th, 2009 at 5:47pm
Print Post  
Are you sure the table has any rows that are not marked as headers?
  
Back to top
 
IP Logged
 
bradaisa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Sep 9th, 2009
Re: How to expand table header row in code?
Reply #3 - Sep 15th, 2009 at 5:55pm
Print Post  
Yes -- in order to get drawn in the first place, each Table must have at least one non-header row -- and when you -+- click, this is confirmed.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to expand table header row in code?
Reply #4 - Sep 15th, 2009 at 5:58pm
Print Post  
Could you save to xml and email us the diagram as it looks before running that code?
  
Back to top
 
IP Logged
 
bradaisa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Sep 9th, 2009
Re: How to expand table header row in code?
Reply #5 - Sep 15th, 2009 at 6:01pm
Print Post  
Ahh... I discovered what is happening... The code-based expansion does not cause the TableNode_SectionExpanded event to trigger, and that event is where I actually resize the TableNode -- so I had to add code to resize the node when I was expanding it in code.

But... it does seem that this is a bug -- I would have expected the SectionExpanded event to trigger regardless whether caused by the user or code...

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to expand table header row in code?
Reply #6 - Sep 15th, 2009 at 6:11pm
Print Post  
The control raises events mostly for users actions. I suppose our developers thought you wouldn't need notifications for actions that you cause yourself from code, so you get notifications only for what's done interactively. There are some exceptions though, e.g. the ValidateAnchorPoint event.
  
Back to top
 
IP Logged
 
bradaisa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Sep 9th, 2009
Re: How to expand table header row in code?
Reply #7 - Sep 15th, 2009 at 6:16pm
Print Post  
Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint