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

How to change in diagram the TextBlock content

4 Answers 229 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Fahd
Top achievements
Rank 1
Fahd asked on 25 Jan 2017, 04:15 PM

Hi, 

I cant find a method for changing the content of textBlock text appended to a shape. In this demo: http://dojo.telerik.com/IDEnA , there is a method for changing the color of the shape, is there a similar method to change the textBlock text. any help ? thank you.

4 Answers, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 27 Jan 2017, 12:08 PM

Hello,

You can define the color of the text in a TextBlock by changing the fill option. If you wish to change the background of the text, then you could put the TextBlock in a Rectangle and set its fill color.

Hope this helps.

Regards,
Niko
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Fahd
Top achievements
Rank 1
answered on 27 Jan 2017, 01:17 PM

Hi Niko,

Thanks for the replay, but i think you did not well understand my problem, i want to change the text it self not the color, i used the color as an example, my real issue is with the text content. In this link (  http://dojo.telerik.com/IDEnA  ) there is a comment that well describes my issue i hope you can check it out.

0
Accepted
Niko
Telerik team
answered on 30 Jan 2017, 03:03 PM

Hello,

Please, check a couple of options for updating the text of a particular shape and then redraw the shape with the new value - http://dojo.telerik.com/OjobUb.

First option is to change the individual dataItem of the shape, then use the redrawVisual method to apply the change to the visual. This method is a simplification of the the approach you proposed in your post. The drawback here is that the dataSource is out of sync with the shape.

The second option is to change the dataSource - will it be through a call to the server or update the data on the client-side. Then call the refresh method of the diagram. The shapes get the updated data from the dataSource and get recreated.

Regards,

Niko

Telerik by Progress

Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Fahd
Top achievements
Rank 1
answered on 03 Feb 2017, 10:56 AM

Hi Niko,

Thank you very much for your help, that's really what I was looking for.

 

 

Tags
Diagram
Asked by
Fahd
Top achievements
Rank 1
Answers by
Niko
Telerik team
Fahd
Top achievements
Rank 1
Share this question
or