RadNumericUpDown control NumberGroupSeparator doesnt work inside radgridview template

2 posts, 0 answers
  1. Kiran
    Kiran avatar
    17 posts
    Member since:
    Aug 2012

    Posted 09 Dec 2014 Link to this post

    Hi experts,

    I might have a isolated issue here. Not sure if I'm missing anything :) I have a RadGRidView and im using NumericUpdown control for data entry. The NumericUpdown control NumberGroupSeparator is not working. It doesnt show the 'comma'. If the take the same control out of the the grid, it works fine. I have attached my code here. I know by default the group separator should work, but as it was not working I also tried adding that extra numberFormatInfo xml code, but with no luck. The data member that  I'm binding is a double(should be an int)
    Please let me If I'm missing anything.

    Thanks in advance.
  2. Boris
    Admin
    Boris avatar
    276 posts

    Posted 11 Dec 2014 Link to this post

    Hi Kiran,

    In general the group separator will not be shown during the edit of the NumericUpDown control, it will show itself after the control is not focused.

    In your case the NumericUpDown is placed as a CellEditTemplate for the GridViewDataColumn, which means that the group separator will not be shown at all after you commit the changes. That is so because then the default CellTemplate is displayed.

    A possible way to show the group separator, after the edit has finished and you are viewing the default CellTemplate (a bound TextBlock), is to set the DataFormatString property of the column to "{}{0:N0}" or "{}{0:0,0}" like so: 

    <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}" DataFormatString="{}{0:N0}">
        <telerik:GridViewDataColumn.CellEditTemplate>
            ...            
        </telerik:GridViewDataColumn.CellEditTemplate>
    </telerik:GridViewDataColumn>

    For more information about how to set up the DataFormatString property, you can check the Data Formatting documentation article.

    On a side note if you need to display the group separator during edit I would recommend that you check the GridViewMaskedInputColumn column and RadMaskedInput control.

    I hope this helps.


    Regards,
    Boris
    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top