Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) LaneGrid Feature Support (Read 7762 times)
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
LaneGrid Feature Support
Aug 10th, 2009 at 3:45pm
Print Post  
Hi,

I need to work with LaneGrid of the WPFDiagram.

I need to know whether the Lane Grid supports the following features:

- providing context menu on the lanes(Row headers).
- Text for RowHeaders be made Vertically Center aligned.
- Hiding the row seperator line for SubHeders of RowHeaders.
- Making the subHeaders for row and column to be invisible ie. they exist but only the Parent Header is Visile and not the subheaders.

It will be very helpful if ypu can provide me a sample for the supported features(from above list).

Thanks,
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #1 - Aug 11th, 2009 at 5:16am
Print Post  
Hi,

To add further to the above post:

- need to know whether we can add image and text both to the Title of the RowHeader.

Thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LaneGrid Feature Support
Reply #2 - Aug 11th, 2009 at 8:20am
Print Post  
Hi,

This example shows how to display a context menu and hide subheaders:
https://mindfusion.eu/_samples/wpf_lanes.zip

The enclosed diagramming assembly adds a DrawLaneHeader event that lets you custom-draw the headers. You could use that to add images and other graphics to the headers.

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


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #3 - Aug 13th, 2009 at 9:29am
Print Post  
Hi,

Thanks for your reply.
Now I am able to create context menu on RowHeaders.

Still the issue are:

- The same image appear on each RowHeader, however I want to display different images on different RowHeaders along with its Title.

- Also I need to hide the rows which are created when any SubHeader is added to RowHeader.

How can this be implemented ?

Could you please provide me with its sample code.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid Feature Support
Reply #4 - Aug 13th, 2009 at 1:04pm
Print Post  
The DrawLaneHeader event is fired for each header individually. You can identify the header for which the event is raised and draw the image appropriate for this header. For example, the following code draws lines with different width and color for different headers:

Code
Select All
void Diagram_DrawLaneHeader(object sender, DrawHeaderEventArgs e)
{
	int index = 0;
	if (e.Header.IsRowHeader)
		index = diagramView1.Diagram.LaneGrid.GetRowIndex(e.Header);
	else
		index = diagramView1.Diagram.LaneGrid.GetColumnIndex(e.Header);

	e.Graphics.DrawLine(new Pen(e.Header.IsRowHeader ? Brushes.Red : Brushes.Green, index), e.Bounds.TopLeft, e.Bounds.BottomRight);
} 


Regarding the second problem, I am not completely certain what you are asking. If you want to have sub-headers without corresponding cells in the grid, this is not possible. If you want to have sub-headers but you do not want them to be visible, you can assign zero for their height or width as is done in the sample above (the first row has two sub-headers which are "invisible") .

Regards,
Meppy
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #5 - Aug 14th, 2009 at 6:36am
Print Post  
Hi,

Thanks for the reply.
Now I am able to set the images as per specific Header Title

Is there any databinding feature avaialble for LaneGrid.?

If yes could you please update the above sample program to demonstrate binding.

Thanks
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #6 - Aug 14th, 2009 at 2:27pm
Print Post  
Hi,

I am trying to change the BackgroundColor of a Header on Diagram_Clicked event

like:
Code
Select All
if (header.Title == "some text")
{
   if (header.Style.BackgroundBrush==Brushes.Cyan)
	  header.Style.BackgroundBrush = Brushes.Red;
  else
	  header.Style.BackgroundBrush = Brushes.Cyan;
}
 



But the color is not refelecting on the Lane Header.
Please let me know if I am missing something.

Thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LaneGrid Feature Support
Reply #7 - Aug 17th, 2009 at 10:27am
Print Post  
Hi,

You could call InvalidateVisual on the header elements to refresh them. This version does that automatically when you change the brush:

https://mindfusion.eu/_beta/wpfdiag_refreshlanes.zip

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


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #8 - Aug 17th, 2009 at 12:30pm
Print Post  
Hi,

Thanks for the reply,
It worked...!!!!

I need to know something more about the LaneGrid:

- How could I add the HeaderAdded event for Lanegrid in xaml(and in code behind as well.)

- Can I bind the grid to any DataSource..???

- Can the rows in Lanegrid be merged automatically based on any condition(at run time) or do we need to provid the code to handle this.


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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid Feature Support
Reply #9 - Aug 17th, 2009 at 3:17pm
Print Post  
Hi,

Here are the answers to your questions:

Quote:
- How could I add the HeaderAdded event for Lanegrid in xaml(and in code behind as well.)

Diagram.LaneGrid, being a read-only property, is currently inaccessible in XAML and therefore its events can only be handled in-code. Keep in mind that this event is raised only when the headers are added interactively (through CTRL+Header resize). Adding headers through code will not raise this event.

Quote:
- Can I bind the grid to any DataSource..

Unfortunately databinding on the lane grid is not supported at this time.

Quote:
- Can the rows in Lanegrid be merged automatically based on any condition(at run time) or do we need to provid the code to handle this.

There is no automatic method for merging grid lanes. If you are using only a single level of headers, merging will be rather trivial - simply delete all the headers being merged, except the last one, and set the height/width of the remaining header to the total of all merged headers.
If you are using multilevel headers (that is, headers with subheaders, and so on), merging might be rather difficult depending on the specific scenario.

Meppy
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #10 - Aug 18th, 2009 at 6:46am
Print Post  
Hi,

Thanks for your reply.

I am not able to access the Item Property of the LaneGrid.

Can u please tell me what could be the reason.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid Feature Support
Reply #11 - Aug 18th, 2009 at 8:57am
Print Post  
The Item property is available only in VisualBasic. In C# you should use the grid indexer, that is:

Code
Select All
diagram.LaneGrid[0, 1]... 


Is that what you were asking for?

Meppy
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #12 - Aug 18th, 2009 at 1:31pm
Print Post  
Hi,
Thanks.

This was only i was looking for.

- Can we not set the Height of Subheaders less than 40.(is it restricted as i am not able to set the height to 10)

- And can't we change the Header's Title at runtime(like giving a different title at Diagram_Clicked event to the clicked header??).

I am not able to set the title at run time.

Please provide me with a solution.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LaneGrid Feature Support
Reply #13 - Aug 19th, 2009 at 6:12am
Print Post  
Quote:
- Can we not set the Height of Subheaders less than 40.(is it restricted as i am not able to set the height to 10)

Try changing the value of the Diagram.LaneGrid.MinHeaderSize property.

Quote:
- And can't we change the Header's Title at runtime(like giving a different title at Diagram_Clicked event to the clicked header??).

Are you using the modified version of the control posted above? Because in previous versions, the header titles did not cause refresh when changed.

Regards,
Meppy
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: LaneGrid Feature Support
Reply #14 - Aug 19th, 2009 at 2:56pm
Print Post  
Hi,

Thanks for the reply...

Setting the MinHeaderSize worked...

And also the Header Titles are changed with the modified dll's.

When these new dll's will come along with new licensed version.

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