Format Edited Value

7 posts, 0 answers
  1. Steven
    Steven avatar
    39 posts
    Member since:
    Jul 2012

    Posted 14 Feb 2013 Link to this post

    Hi,

    When I edit cell values the new values don't get formatted.

    For example, if I edit a value on a column which has a data format string of N2 and I enter the number 1.2345678 I would expect the number to be formatted to 1.23 but the full number is displayed.

    I was wondering if there was a way to get the edited values to adopt the formatting specified on the column?

    Thanks,

    Steven
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Feb 2013 Link to this post

    Hello,

     Generally formats are used only for display purposes. Still if you want to use this when edit values you can place TextBox in desired column CellTemplate and specify desired format for the Text property binding. 

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Steven
    Steven avatar
    39 posts
    Member since:
    Jul 2012

    Posted 14 Feb 2013 Link to this post

    Hi Vlad,

    Displaying the full value whilst editing it is fine, but after I finish editing the value I would like it to be displayed formatted as the rest of the values in the column.

    Thanks,

    Steven
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Feb 2013 Link to this post

    Hello Steven,

     Are you using DataFormatString property of the column or StringFormat property of the DataMemberBinding? 

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Steven
    Steven avatar
    39 posts
    Member since:
    Jul 2012

    Posted 15 Feb 2013 Link to this post

    Sorry I think I misinterpreted your original reply. I am using the DataFormatString on the column. If i add a template to the CellTemplate with the format specified on the binding as you suggested in your first reply will that work?

    Thanks,

    Steven
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 19 Feb 2013 Link to this post

    Hello Steven,

     Can you send us small example project demonstrating your scenario via support ticket? We will review once going on in your case and we will let you know about our findings.

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Steven
    Steven avatar
    39 posts
    Member since:
    Jul 2012

    Posted 21 Feb 2013 Link to this post

    Hi,

    I figured out my problem. We are building the grids dynamically and the grids contain various types of data so each of the cells are bound to a value of type object. When we create the grid the numbers are of type double so they are formatted. After we edit the values they become type string so the formatting is not applied.

    Thanks for your help,

    Steven
Back to Top