I was asked to show relations between data in a graph.
For example
object0 is related to object1 and object2
object1 is related to object 2
object2 is related to object0 and object1
object3 is related to object 1

then the graph will be as shown here Click Here

I searched for that and found this link which is the one I need but it is in 'WPF' or silverlight maybe which I don't know anything about it. I searched for a way to run the 'wpf' from the windows form project that I have but no good results.

I can use the 2 classes of the quickgraph demo (PocEdge.cs,PocVertex.cs) which I think that represents a graph datastructure and I can use a query to find objects related to each of the above objects and use the AddNewGraphEdge() to relate other objects to vertex.
but the problem is how can I draw the graph in the windows form project that I have.

If I am using the wrong way please correct it to me.

Recommended Answers

All 4 Replies

If you have VS Ultimate (2010 or newer), looks like you could add a "Modeling Project" to your solution. See the following:

How to: Create UML Modeling Projects and Diagrams

If this is for a class, you can use MS Visio or MS Word, or just draw it out on paper.

Object Modeling

Search for "Object Model"

Note: There are standards that have been defined. Shapes have a meaning (rectangle, elipse, line with arrow, etc...)

these objects are found in database and they are dynamic so each time data will be fetched from database according to user input and create a graph datastructure (vertices and edges) and then draw this graph.

You should be able to create a user control for this in the WPF side and then use an element host in your winforms application. Here is a nice link describing it Click Here. You'll probably need to take the plunge and sharpen up on your WPF though. even if it's just a little bit

thanks @Fenrir() that linked helped a lot and it was solved without knowing any wpf :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.