barcode position using c#

6 posts, 0 answers
  1. heba
    heba avatar
    8 posts
    Member since:
    Sep 2013

    Posted 17 Mar 2014 Link to this post

    Hi,
    I have div that has barcode and QR. I want to control position of barcode and QR ( top , left , margin ) in code behind using c# because position coming from DB. 
    How can I do that ? 
    Thanks
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Mar 2014 in reply to heba Link to this post

    Hi heba,

    Please try the following C# code snippet to achieve your scenario.

    C#:
    string left = "25%",top="15%";
    RadBarcode1.Style.Add("margin-left", left);
    RadBarcode1.Style.Add("margin-top", top);

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. heba
    heba avatar
    8 posts
    Member since:
    Sep 2013

    Posted 18 Mar 2014 in reply to Princy Link to this post

    Thanks for your help,
    It work but I have another problem, I am displaying a Code11 barcode with the Text . On decreasing the ShortLinesLengthPercentage, I recently found the text got very far from the barcode. I want to control position of text How can I fix this?
  5. Gorge
    Gorge avatar
    2 posts
    Member since:
    Apr 2014

    Posted 28 Apr 2014 in reply to heba Link to this post

    hi ,how about setting text position with below codes:[code]

    //Instantiate barcode object
    BarCodeBuilder bc = new BarCodeBuilder();

    //Set the Code text for the barcode
    bc.CodeText = "9999999";

    //Set the location of the code text to above the barcode
    bc.CodeLocation = CodeLocation.Above;[/code]

    BTW, I'm evaluating free barcode component recommended by CodePlex and trying to figure out difference this one and RedBarcode.Once I got result,I 'll share with you guys.

    kind regards
  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1796 posts

    Posted 01 May 2014 Link to this post

    Hello Heba,

    When you are changing the ShortLinesLengthPercentage to lower value, it is expected that there will be space between the text and the lines. Nevertheless, RadBarcode allows you to set the vertical position of the text through the VerticalTextPositionPercentage property. Following is a simple example demonstrating how to set both properties:
    <telerik:RadBarcode runat="server" Type="Code11" ShortLinesLengthPercentage="55" VerticalTextPositionPercentage="70"
        Height="100px" Width="500px" Text="1312313"></telerik:RadBarcode>

    Hope that helps.


    Regards,
    Konstantin Dikov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Mariah
    Mariah avatar
    5 posts
    Member since:
    Oct 2013

    Posted 07 May 2014 in reply to Gorge Link to this post

    Gorge said:hi ,how about setting text position with below codes:[code]

    //Instantiate barcode object
    BarCodeBuilder bc = new BarCodeBuilder();

    //Set the Code text for the barcode
    bc.CodeText = "9999999";

    //Set the location of the code text to above the barcode
    bc.CodeLocation = CodeLocation.Above;[/code]

    BTW, I'm evaluating free barcode component recommended by CodePlex and trying to figure out difference this one and RedBarcode.Once I got result,I 'll share with you guys.

    kind regards

    so how is the result ?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017