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

GridNumericColumn: How to set the number seperator within the Filter Row?

4 Answers 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RD
Top achievements
Rank 2
RD asked on 07 Jun 2010, 11:04 PM
I have a grid with the auto-filter row enabled, ie:  

<

 

telerik:RadGrid ... AllowFilteringByColumn="True" />

 


I have a number of GridNumericColumn within the grid, ie:

<

 

telerik:GridNumericColumn DataField="CityId" DataType="System.Int32" HeaderText="ID" SortExpression="CityId" UniqueName="CityId" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" AutoPostBackOnFilter="true"/>

 


When filtering for an ID above 1000, the filter row displays the identifier with a thousands seperator...
As an example, take a look at the following image:  http://screencast.com/t/MjdjMmUyNWY  (captured with Techsmith's Jing).

Is there a way to eliminate the thousand's seperator?

Thanks,

Roy

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 08 Jun 2010, 06:04 AM
Hello,

In order to remove the comma seperator, access the RadNumericTextBox in ItemCreated event and set the GroupSeperator property as shown below.

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

Regards,
Shinu.
0
RD
Top achievements
Rank 2
answered on 24 Jun 2010, 03:17 AM
Thanks Shinu - that works perfectly.

A shame this can't be set declaratively within the ASPX page.
0
Andrea
Top achievements
Rank 2
Iron
answered on 13 Oct 2010, 01:20 PM
I agree with RD!
0
Josep Bonet
Top achievements
Rank 1
answered on 18 Nov 2010, 02:40 PM
I agree too. It's strange the filter and edit mode are not following the same pattern as the displayed data and that you have to modify it manually through code.
Tags
Grid
Asked by
RD
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
RD
Top achievements
Rank 2
Andrea
Top achievements
Rank 2
Iron
Josep Bonet
Top achievements
Rank 1
Share this question
or