changing textbox value to title case

2 posts, 0 answers
  1. Naureen
    Naureen avatar
    20 posts
    Member since:
    Oct 2016

    Posted 04 Apr Link to this post

    how can i change my data to camel-case or proper-case (like first word of each letter to be capital) in text box, something like 

    this is example -> This Is Example

  2. Silviya
    Admin
    Silviya avatar
    359 posts

    Posted 09 Apr Link to this post

    Hi Naureen,

    You can create your own user-defined function where you can apply the logic for converting a string to camel-case or proper-case. For example:
    [Function(Category = "My Test Functions", Namespace = "MyTestFunctions", Description = "Return Proper Case String")]
    public static string ToProperCase(string text)
    {
        var words = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
             .Select(word => word.Substring(0, 1).ToUpper() +
                             word.Substring(1).ToLower());
     
        var result = String.Concat(words);
        return Regex.Replace(result, "(\\B[A-Z])", " $1");
    }

    How to create and use custom function is explained in User Functions help article.
    Note that to use custom functions inside the Standalone Designer it needs to be extended - check Extending Report Designer help article for reference. The designer folder is placed in default Telerik Reporting installation folder, e.g. C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Report Designer). 

    Best Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top