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

How to set a StringFormat in a textblock inside the AdornmentInfo?

Thread ID:





124056 May 11,2016 08:44 PM UTC Sep 23,2016 08:55 AM UTC WPF 5
Tags: SfDiagram
Tomas Raziel Garza Amaya
Asked On May 11, 2016 08:44 PM UTC

I tried some alternatives, any works.
No works: Text="{Binding StringFormat={}{0:C}}"
No works: Text="{Binding StringFormat=${0:C}}"
No works: Text="{Binding Path=SomeNumber, ConverterCulture='en-US', StringFormat={} {0:C}}"
No works: Text="{Binding Path=Number, StringFormat={} {0:##.0}}"

I want to show this number: 300000000 in $300,000,000 in the adornmentInfo.

Thanks for help.

Samuel Rajadurai Edwin Rajamanickam [Syncfusion]
Replied On May 12, 2016 11:54 AM UTC

Hi Tomas,

Thanks for contacting Syncfusion Support.

For applying required format, we need to apply the string format as like in the below code example. 
Code Snippet: 
<DataTemplate x:Key="TextTemplate"> 
     <TextBlock Background="Red" Text="{Binding YData,StringFormat=C0}" Padding="5"/> 
Demo sample: Column
For more information about the adornments, please refer the below documentation link. 

Tomas Raziel Garza Amaya
Replied On May 12, 2016 03:17 PM UTC

Thanks, its works

Samuel Rajadurai Edwin Rajamanickam [Syncfusion]
Replied On May 13, 2016 04:45 AM UTC

Hi Tomas,

We are glad that your requirement has been met.

Please let us know if you have any queries.


Replied On September 22, 2016 11:58 PM UTC

Hi Tomas,

We are glad that your requirement has been met.

Please let us know if you have any queries.


can you help me?
as I can assign a specific value to a textblock, I'm using Diagramming of Syncfusion, but in the draft DiagramBuilder cannot assign a special value.
I am using wpf.
I teach them the code.

 <!--Número de Escenario de Etiqueta-->
    <DataTemplate x:Key="ndede">
        <Viewbox Stretch="Fill">
                <TextBlock Text="Número de Escenario de Etiqueta"></TextBlock>

the name of the class is DiagramBuilderUI.xaml

Attachment: error_d7834f61.rar

Keerthivasan Ramamoorthy [Syncfusion]
Replied On September 23, 2016 08:55 AM UTC

Hi Fernando, 
Requirement:” Need to Add text and change this text according to different SymbolItems”. 
We have analyzed and achieved your requirement in DiagramBuilder. Please refer the code example as below. 
Code Example: 
Add your text into Content Property of the NodeViewModel. 
<syncfusion:NodeViewModel Key="Basic Shapes" Content="Número de Escenario de Etiqueta" UnitHeight="50" UnitWidth="50" OffsetX="100" OffsetY="100" Shape="{StaticResource Rectangle}" ShapeStyle="{StaticResource SymbolStyle}"></syncfusion:NodeViewModel> 
Add ContentTemplate Property inside the NodeView Style.  
<Style TargetType="{x:Type view:NodeView}" BasedOn="{StaticResource NodeBindingStyle}"> 
        <Setter Property="Background" Value="Transparent"/> 
        <Setter Property="ContentTemplate"> 
                    <Viewbox Stretch="Fill"> 
                            <TextBlock Text="{Binding}"></TextBlock> 
In NodeVM.CS class, remove the Content= null from the ContentDummy Property. 
        public string ContentDummy 
            get { return _content; } 
                _content = value; 
                Shape = value; //Clone(value); 
                Content = null; 
We have used ContentTemplate Property to Display the Content of the NodeViewModel. 
If the provided information not meet your requirement, please provide more details like sample/video to represent your requirement. This helps us to provide a prompt solution at the earliest. 
Keerthivasan R. 


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

or the page will be automatically redirected to 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