Need To set Canvas Margin based on TextBlock text Lenght

4 posts, 0 answers
  1. Ramesh
    Ramesh avatar
    22 posts
    Member since:
    Oct 2013

    Posted 25 Sep 2014 Link to this post

    Hi Telrik,

    In project , I  I have a requirment that is when i enter data in a textbox  that ented text is displinh in a Textblox based on text block lenght canvs control margin need to set .

    if you see the image the lable is  size is increasing to right side when test increases but i need that size has to increse both the sides means left side and right side also.

    kindly see the follwing code bellow .

    have a look to atttached pictures please

    it is urgent please help me as soon as possible.

    <Canvas x:Name="wpRect" Canvas.Left="85" Canvas.Top="-32" Width="30" Height="30">

    <!-- // Demond Id 541: following code is for to change circlequantity to Rectangle Quantity. Done by Ramesh 878173 -->
    <Border BorderThickness="1" BorderBrush="Black" MinWidth="30" MaxWidth="100" Background="White">
    <TextBlock x:Name="lblWPQtyCircle" Canvas.Left="4" Canvas.Top="7" Height="20" Text="{Binding Quantity}" ToolTipService.ToolTip="{Binding Quantity}"
    Width="Auto" TextAlignment="Center" FontFamily="Arial Black" HorizontalAlignment="Center"
    MouseLeftButtonUp="lblWPQtyCircle_MouseLeftButtonUp" MouseEnter="lblWpQtyCircle_MouseEnter"
    MouseLeave="lblWPQtyCirle_MouseLeave" RenderTransformOrigin="0.5,0.5" SizeChanged="lblWPQtyCircle_SizeChanged">
    <TextBox x:Name="txtWPQtyCircle" Visibility="Collapsed" Canvas.Left="4" Canvas.Top="5" MinWidth="30" Height="20" Text="{Binding Quantity, Mode=TwoWay}"
    CAST_Common_Controls:TextBoxFilter.Filter="PositiveInteger" Width="Auto" TextAlignment="Center" FontFamily="Arial Black"
    KeyUp="txtWPQtyCircle_KeyUp" LostFocus="txtWpQtyCircle_LostFocus" RenderTransformOrigin="0.2,0.2"
    FontSize="13" Style="{StaticResource CircleTextBoxStyle}">
    <!--End 541-->
  2. Ramesh
    Ramesh avatar
    22 posts
    Member since:
    Oct 2013

    Posted 29 Sep 2014 Link to this post

    Hi Team ,
    could help on this please . I awiating for your support.
  3. Petya
    Petya avatar
    983 posts

    Posted 29 Sep 2014 Link to this post

    Hello Ramesh,

    This question does not seem related to any of the controls in the Telerik UI for Silverlight suite, so I'd suggest addressing it either in the MSDN forums or another developer community forum like Stack Overflow.

    I also did a quick internet search and there seem to be numerous resources discussing the topic, for example:
    If you have any question concerning any of the Telerik controls please let us know and we will gladly assist you.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  4. Ramesh
    Ramesh avatar
    22 posts
    Member since:
    Oct 2013

    Posted 01 Oct 2014 in reply to Petya Link to this post

    Hi ,

    Thank you so much it working fin as per your suggesion
Back to Top