This is a migrated thread and some comments may be shown as answers.

Rad Diagram Control in Q2 2011

2 Answers 108 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Swati
Top achievements
Rank 1
Swati asked on 13 Jun 2012, 07:25 AM
Hi All,

I am currently using Q2 2011 Rad controls..and Rad Diagram is not included in this install....How can I use Rad Diagram Control in Q2 2011?

Also can I get any working  example of the same?

Please reply as early as possible..

Regards,
Swati

2 Answers, 1 is accepted

Sort by
0
Swati
Top achievements
Rank 1
answered on 03 Aug 2012, 08:52 AM
Hi,

Can we create our own controls like Rectangle, Ellipse and add them to the Rad Diagram for performing all the functionality which are supported by Rad Diagram?

Please send us example. I need to add Rectangle to the Rad Diagram and need to change its color, size... How to do that???

To dynamically get control I used below code:

RadDiagramShape shape=new RadDiagramShape();
            shape.Geometry= ShapeFactory.GetShapeGeometry(CommonShapeType.RectangleShape);
            raddiag.AddShape(shape);

foreach (RadDiagramShape sample in raddiag.Items)
                {
                sample.Background  = newBrush;
                }

And used the foreach loop to get the control and apply color... but  we are not able to get any item in raddiag.Items it is showing null.. what we are missing here???? please let us know...

Keenly waiting for reply...

Regards,
Swati
0
Tina Stancheva
Telerik team
answered on 07 Aug 2012, 02:34 PM
Hello Swati,

I am not sure why the Items collection is empty in your case. However, you can take advantage of the predefined shape geometries and apply them either in xaml or in code-behind. Then in order to change the appearance of the shapes you can apply an explicit style on the shapes, or define a RadDiagramShape style through the RadDiagram.ShapeStyle property or you can define an implicit style for all RadDiagramShapes.

Also, please note that the RadDiagram exposes a Shapes collection that contains all shapes defined in it, while the items collection contains the RadDiagramConnection elements as well.

I attached a sample solution, please have a look at it and let me know if it helps or if I'm missing something.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Swati
Top achievements
Rank 1
Answers by
Swati
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or