Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TableNode with standard scrollbar (Read 2112 times)
Soar
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Sep 11th, 2013
TableNode with standard scrollbar
Sep 11th, 2013 at 10:43am
Print Post  
Hello, I'm use TableNode to perform a database table.
But we prefer standard scrollbar(like TreeViewNode's), not TableNode's scroll button.
Is there any way to attch a standard scrollbar to TableNode?
Or I should combine several DiagramNode to accomplish It?

Please give me some suggestion, Thanks!!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode with standard scrollbar
Reply #1 - Sep 11th, 2013 at 1:46pm
Print Post  
You could attach a ControlNode containing a scrollbar to the table:

Code
Select All
var table = diagram.Factory.CreateTableNode(0, 0, 40, 80, 4, 100);
for (int i = 0; i < table.RowCount; i++)
	table[0, i].Text = i.ToString();

var scrollbar = new VScrollBar();

var rect = table.Bounds;
rect.Width = diagramView.ClientToDoc(scrollbar.ClientRectangle).Width;
rect.X = table.Bounds.Right - rect.Width;

var scrollbarNode = new ControlNode(diagramView, scrollbar);
scrollbarNode.ControlPadding = 0;
scrollbarNode.Bounds = rect;
diagram.Nodes.Add(scrollbarNode);

scrollbarNode.AttachTo(table, GroupAnchorStyles.Right |
	GroupAnchorStyles.Top | GroupAnchorStyles.Bottom);

scrollbar.Maximum = table.RowCount;
scrollbar.ValueChanged += (s, args) => table.CurrentScrollRow = scrollbar.Value; 



You will need to re-attach the scrollbar.ValueChanged handlers after loading a file.

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


I Love MindFusion!

Posts: 2
Joined: Sep 11th, 2013
Re: TableNode with standard scrollbar
Reply #2 - Sep 12th, 2013 at 8:25am
Print Post  
It works fine, thanks!!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint