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
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
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.
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,
NikoTelerik by Progress
Hi Niko,
Thank you very much for your help, that's really what I was looking for.