Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Change the grid lines in a SwimlaneLayout (Read 2491 times)
Tom
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 2nd, 2014
Change the grid lines in a SwimlaneLayout
Apr 2nd, 2014 at 6:28pm
Print Post  
How can I change the color of the gridlines in a Swimlane layout?
I'm new to this so a code sample would be much appreciated.
Thanks,
Tom
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Change the grid lines in a SwimlaneLayout
Reply #1 - Apr 2nd, 2014 at 6:50pm
Print Post  
Try this:

Code
Select All
Style s = diagram.LaneGrid[null, null].Style;
s.LeftBorderPen =
	s.TopBorderPen =
		s.RightBorderPen =
			s.BottomBorderPen =
				new Pen(Color.Red); 



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


I Love MindFusion!

Posts: 6
Joined: Apr 2nd, 2014
Re: Change the grid lines in a SwimlaneLayout
Reply #2 - Apr 3rd, 2014 at 7:08pm
Print Post  
Hi,

Thanks for this. This works fine in c#. I'm working in another language with imperfect support of the CLR. One of the limitations is that it can't access a property with more than one index. Now it was easy for me to write a quick C# dll to work around this but I would like to know if there's an alternative that does not require me to use a dual indexed property?

Thanks,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Change the grid lines in a SwimlaneLayout
Reply #3 - Apr 4th, 2014 at 10:38am
Print Post  
Hi,

There is no other way to access it using the public API. You could use .NET reflection instead if your language allows it:

Code
Select All
Type headerType = typeof(MindFusion.Diagramming.Lanes.Header);
Type gridType = typeof(MindFusion.Diagramming.Lanes.Grid);

PropertyInfo cellProperty = gridType.GetProperty(
	"Item", new Type [] { headerType, headerType });
ICell cellRange = (ICell)cellProperty.GetValue(
	diagram.LaneGrid, new object[] { null, null });

Style s = cellRange.Style;
s.LeftBorderPen =
	s.TopBorderPen =
		s.RightBorderPen =
			s.BottomBorderPen =
				new Pen(Color.Red); 



I hope that helps,
Stoyan
« Last Edit: Apr 7th, 2014 at 1:56pm by Stoyo »  
Back to top
 
IP Logged
 
Tom
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 2nd, 2014
Re: Change the grid lines in a SwimlaneLayout
Reply #4 - Apr 5th, 2014 at 12:25pm
Print Post  
Thanks so much. This was very helpful and I was able to make it work.

Tom
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint