filter float format

4 posts, 0 answers
  1. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 28 May 2013 Link to this post

    When using radgrid filter like below, if the bound column is float, the filter has "0.00" as defaut value, is there anyway can have blank in the filter instead of "0.00"?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 May 2013 Link to this post

    Hi JJ,

    Please have a look at the following JavaScript I tried which works fine at my end.

    <script type="text/javascript">
        function pageLoad() {
            var input = document.getElementById("<%= RadFilter1.ClientID %>").getElementsByTagName("input")[0];
            input.defaultValue = " ";

  3. DevCraft R3 2016 release webinar banner
  4. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 29 May 2013 Link to this post


    Thank Shunu.

    My case is I am using filtercontrol which as a radwindow on if for the filter, this filtercontrol -radwinodow is shared by all the grid on the site, on parents page (which has the grid) pass the gridid to the filer control.

    like this demo:


    Is there anyway on the radwindow to check the passing grid to see if data type is integer or float, show blank instead of 0.00? Since the radfilter in radwinodw is shared for all the grid, not good for me to use document.getElementById.

    Thank you,

  5. Eyup
    Eyup avatar
    2941 posts

    Posted 31 May 2013 Link to this post


    You can wait to the Q2 release of RadControls or download the Beta version and use the following event:

    Here is a practical example:
    protected void RadFilter1_ExpressionItemCreated(object sender, RadFilterExpressionItemCreatedEventArgs e)
        RadFilterSingleExpressionItem singleItem = e.Item as RadFilterSingleExpressionItem;
        if (singleItem != null && singleItem.IsSingleValue)
            RadNumericTextBox numBox = singleItem.InputControl as RadNumericTextBox;
            if (numBox != null && numBox.Value == 0)
                numBox.Value = null;

    Hope this helps.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top