Textbox style bindings not working

2 posts, 1 answers
  1. Arun Kumar
    Arun Kumar avatar
    60 posts
    Member since:
    Nov 2009

    Posted 15 Dec 2010 Link to this post

    I want to display value of textbox like treeview in table report item. I am using one database field to set the left padding. But it does not work. If I use html preview it shows as expected but not in normal preview / silverlight application.

    This is what i am doing:

    public static Telerik.Reporting.Drawing.Unit GetLeftPadding(double lvl)
            {
                if (lvl <= 1)
                    return Telerik.Reporting.Drawing.Unit.Pixel(0);
                else
                    return Telerik.Reporting.Drawing.Unit.Pixel(lvl * 15);
            }

    in textbox bindings property I added one new binding with the following:
    Property Path :  Style.Padding.Left
    Expression:  = GetLeftPadding(CDbl(Fields.Lvl))

    What could the reason? Any help would be appreciated.

    Thanks
  2. Answer
    Peter
    Admin
    Peter avatar
    1611 posts

    Posted 20 Dec 2010 Link to this post

    Hello Arun Kumar,

    Unfortunately you are correct and we were able to reproduce the problem. I've logged this issue in our bug tracking system and it would be addressed in a subsequent version of the product. As a workaround our suggestion is to set the value to an user function that will add empty space as shown in the following code snippet:

    public static object GetLeftPadding(double lvl, object value)
            {
                if (lvl <= 1)
                    return value;
                else
                    return " "+value;
            }

    Your Telerik points have been updated for bringing this to our attention. Sorry for the inconvenience.

    Regards,
    Peter
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  3. DevCraft banner
Back to Top