We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Inserting text into a SymbolPaletteItem

Thread ID:





95084 Jun 20,2010 06:38 AM UTC Jun 21,2010 07:10 PM UTC WPF 1
Tags: Diagram
Administrator [Syncfusion]
Asked On June 20, 2010 06:38 AM UTC

This is related to my other question. How do I insert text inside a symbol palette item in the symbol palette toolbox on the side? I am generating the items in that palette programmatically and I want to have a caption on each to label each diagram shape as to what it is.

Jegan R [Syncfusion]
Replied On June 21, 2010 07:10 PM UTC

Hi Michael,

Thanks for your interest in Syncfusion products.

Regarding adding text inside symbol palette item, Symbol palette items can contain any UIElement as its content, provided they must be serializable. A sample has been created please refer the sample form the following link.

Sample Link: http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DiagramSample162235718.zip

To add a text in Symbol palette item, please create a grid and add the required content as its children, along with it create a TextBlock with the required text and added it into Grid’s Children. Now assign this Grid as SymbolPaletteItems Content as shown in the following Code Snippet.

Code Snippet:

//new Symbol palette item
SymbolPaletteItem symbolPaletteItem = new SymbolPaletteItem();
//Content for SymbolPaletteItem
System.Windows.Shapes.Path path = this.Resources["CustomShape"] as System.Windows.Shapes.Path;
Grid g = new Grid();
//Text content for SymbolPaletteITem
TextBlock test = new TextBlock() { Text = "Text", HorizontalAlignment=HorizontalAlignment.Center,VerticalAlignment=VerticalAlignment.Center};
//Add both the contents as grid's children
//Assign the grid as the SymbolPaletteItems' content.
symbolPaletteItem.Content = g;

Please let us know if there are any concerns.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon