Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LaneGrid rowcount (Read 4360 times)
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
LaneGrid rowcount
Apr 27th, 2012 at 10:17am
Print Post  
Hi,


I added few blank lanes to a diagram but the LaneGrid.RowHeaders.Count is returning only the number of lanes with atleast one node in it.

Even diagramLite.GetRect() is not considering lanes with out any nodes in it.

Please advice

Thanks
BinuVC
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid rowcount
Reply #1 - Apr 27th, 2012 at 12:57pm
Print Post  
Hi,

How exactly do you add the blank lanes? Keep in mind that LaneGrid.RowHeaders.Count returns the number of the top-level rows only. If you add rows as children to other rows, this property will not reflect the change. However, you can get the number of leaf rows in the grid through LaneGrid.RowCount.

Regards,
Meppy
  
Back to top
 
IP Logged
 
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
Re: LaneGrid rowcount
Reply #2 - Apr 27th, 2012 at 1:04pm
Print Post  
Hi


I am adding the row header as follows

diagramLite.LaneGrid.RowHeaders.Add(header);

and this is how I am trying to loop through all the rows

for (int i = 0; i < diagramLite.LaneGrid.RowCount; i++)

But after adding few rows, some with nodes and some without, the count returns only the number of rows with nodes.



Thanks
BinuVC
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid rowcount
Reply #3 - Apr 27th, 2012 at 2:07pm
Print Post  
Hi,

I am not able to reproduce this. The rows and columns in the lane grid have no notion of diagram nodes and the returned count should not be affected by this in any way. Is it possible that a swimlane layout has clipped some of the rows as discussed in this thread?

Regards,
Meppy
  
Back to top
 
IP Logged
 
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
Re: LaneGrid rowcount
Reply #4 - Apr 27th, 2012 at 3:27pm
Print Post  
Hi,


Please find the attaced sample code. Also included in the solution is a txt file listing the issues.

My requirement was to resize the host diagramlite control to to the effective size of the lanegrid after applying the layout. Since empty lanes are dissappearing, GetRect is not considering the height of those lanes.

Please advice.


Thanks
BinuVC
  

SilverlightApplication2_001.zip (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid rowcount
Reply #5 - Apr 28th, 2012 at 12:50pm
Print Post  
Hi,

Utilities.GetRect is a convenience method, which returns a rectangle with the current size of the specified element, it doesn't auto-calculate size based on the element's contents. What I would have recommended is actually something that already exists in your sample:

Code
Select All
var rect = diagramLite.LaneGrid.GetColumnHeaderBounds();
rect.Union(diagramLite.LaneGrid.GetRowHeaderBounds());
diagramLite.Bounds = rect; 


Isn't this code doing exactly what you need?

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint