Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Avoid create headers on user interaction (Read 2633 times)
Gabriel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Oct 9th, 2012
Avoid create headers on user interaction
May 21st, 2013 at 9:08am
Print Post  
Hello,
I have a flowchart with the enable grid feature on.

When the user clicks& drag on the edge of a header the header is resized.
When the user crt-clicks& drag on the edge of a header a new header is created.

How can avoid the last behavior? I want that the ctrl-clicks on the header does nothing.

Thank you in advance
Regardas
Gabriel Pulido
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Avoid create headers on user interaction
Reply #1 - May 21st, 2013 at 9:33am
Print Post  
Hi,

The only way to "prevent" this is by handling the LaneGrid.HeaderAdded event and manually removing the newly added header from the grid. The code below illustrates how to do this in the case when the grid contains only a single level of headers. If your grid contains more than one level of headers, you have to recursively search for the newly created header and remove it from its parent.

Code
Select All
if (e.Header.IsRowHeader)
	diagram.LaneGrid.RowHeaders.Remove(e.Header);
else
	diagram.LaneGrid.ColumnHeaders.Remove(e.Header); 


We will consider adding a property that disables this functionality for the next release.

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


I Love MindFusion!

Posts: 30
Joined: Oct 9th, 2012
Re: Avoid create headers on user interaction
Reply #2 - May 21st, 2013 at 10:04am
Print Post  
Thank you,
That was my first aproach but it wasn't working on headers with parents, now I know why Smiley

It would be great if we can just avoid the functionallity as it is a little odd to allow and remove...
Thank you again

Gabriel
  
Back to top
 
IP Logged
 
Gabriel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Oct 9th, 2012
Re: Avoid create headers on user interaction
Reply #3 - May 21st, 2013 at 10:09am
Print Post  
Just another question,
What is the best way to traverse the Headers jerarquy to remove the newly added header?

Gabriel
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Avoid create headers on user interaction
Reply #4 - May 21st, 2013 at 10:45am
Print Post  
This is the shortest one I can think of:

Code
Select All
Header parent = diagram1.LaneGrid.GetHeaderParent(e.Header);
if (parent != null)
{
	parent.SubHeaders.Remove(e.Header);
}
else
{
	if (e.Header.IsRowHeader)
		diagram1.LaneGrid.RowHeaders.Remove(e.Header);
	else
		diagram1.LaneGrid.ColumnHeaders.Remove(e.Header);
}
 


GetHeaderParent will return null for top-level headers, so you still have to rely on the previous code.

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