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

5 posts, 1 answers
  1. RD
    RD avatar
    12 posts
    Member since:
    Dec 2009

    Posted 07 Jun 2010 Link to this post

    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
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Jun 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. RD
    RD avatar
    12 posts
    Member since:
    Dec 2009

    Posted 23 Jun 2010 Link to this post

    Thanks Shinu - that works perfectly.

    A shame this can't be set declaratively within the ASPX page.
  5. Andrea
    Andrea avatar
    64 posts
    Member since:
    Jan 2005

    Posted 13 Oct 2010 Link to this post

    I agree with RD!
  6. Josep Bonet
    Josep Bonet avatar
    9 posts
    Member since:
    Aug 2009

    Posted 18 Nov 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017