This is a migrated thread and some comments may be shown as answers.

GRoupSeparator in GridNumericColumn Filter Textbox

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Albert Shenker asked on 04 Jan 2017, 05:13 PM
I have a client-side bound grid with filtering. I also have a GridNumericColumn set to type Int32. When I type in the grid filter box, the value displayed automatically includes a comma group separator, like "96,546". How do I get rid of the comma separator so it only displays "96546"?

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 09 Jan 2017, 12:40 PM
Hello Albert,

By default the GridNumericColumn is using a NumericTextBox for a filter input. It formats the numeric value that is entered based on the Culture applied on the page. This is why you are seeing a separator for the entered number.

If you would like to change the behavior you can handle the ItemCreated event for the RadGrid and set the GroupSeparator for the numeric input manually. The code snippet below outlines the approach:


protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridFilteringItem)
    {
        GridFilteringItem filerItem = (GridFilteringItem)e.Item;
        RadNumericTextBox textItem = (RadNumericTextBox)filerItem["NumericColumn"].Controls[0];
        textItem.NumberFormat.GroupSeparator = "";
    }
}



Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Answers by
Viktor Tachev
Telerik team
Share this question
or