QRCodeGenerator DisplayText property does not work.

The DisplayText property does not seem to be working. Would you have any input on what could be wrong?






5 Replies

AR Aravind Ravi Syncfusion Team December 6, 2021 12:46 PM UTC

Hi Ajit,

We have created a sample to show text for the barcode. In barcode generators You can customize or display the barcode text by using display Text property . In the text property of DisplayText bind the barcode value, so that whenever you change the qr code value, the modified text is shown under barcode. Please refer to the below code snippet 

<input @bind="BarcodeValue" @onclick=@ButtonClicked /> 

<SfQRCodeGenerator Width="200px" Height="150px" Value="@BarcodeValue"> 
    <QRCodeGeneratorDisplayText text="@BarcodeValue"></QRCodeGeneratorDisplayText> 
</SfQRCodeGenerator>

@code 
    public int val = 0; 
    public string BarcodeValue = "SYNCFUSION"; 
     
    void ButtonClicked() 
   
        val = 0; 
   

We have attached a video demonstration of how QR code and its text gets changed based on given input. 

Aravind Ravi 



AG ajit goel December 6, 2021 02:36 PM UTC

My question is that I do not want the text to show below the barcode. However the system shows the text below the barcode. How do I ensure that the text does not show below the barcode? 



AR Aravind Ravi Syncfusion Team December 7, 2021 12:27 PM UTC

Hi Ajit, 

By using the Visibility property of QRCodeGeneratorDisplayText we can able to hide the text for the barcode. Please refer to the below code snippet 

<SfQRCodeGenerator Width="200px" Height="150px" Value="@BarcodeValue"> 
    <QRCodeGeneratorDisplayText text="@BarcodeValue" Visibility="false"></QRCodeGeneratorDisplayText> 
</SfQRCodeGenerator> 

Regards 
Aravind Ravi


AG ajit goel replied to Aravind Ravi December 10, 2021 01:34 AM UTC

Please close this ticket. 



AR Aravind Ravi Syncfusion Team December 10, 2021 12:08 PM UTC

Hi Ajit, 

Thanks for the update 

Regards 
Aravind Ravi 


Loader.
Up arrow icon