Numeric Column Percent is not divided by 100

32 posts, 1 answers
  1. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 26 May 2009 Link to this post

    Hi,

    I am using a RadGrid (Q1 2009) to edit a column of "percentages" and I am not getting the behaviour I would expect - though my expectation may be wrong.

    The values stored in the database are "factors" i.e. 0.015 (for a number which the user should "see" as 1.5%), and, if I set the DataFormatString to be {0:p4} my values are displayed as expected (they are multiplied by 100 and displayed to 4 decimal places).

    I would like the user to edit the values in the same way i.e. they edit/enter 12.5600% and what gets written to the database is 0.125600 and what is then re-displayed is 12.5600 %. But leaving the NumericType as "Number" ignores the DataFormatString (the value is displayed as 0.1256), and setting the NumericType to "percent" just results in a % sign being appended to the unmultiplied number (so they have to edit it as 0.125600%) which is frankly wrong.

    It seems a little odd to me - is this intentional (by design), is there anything I can do to easily fix it?
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 28 May 2009 Link to this post

    Hello Andrew,

    This issue has already been reported to us. We will think about a way to improve this behavior in the future.

    In the meantime, you can use the following workaround:

    1. When displaying the edit form, you can modify the value, which is retrieved from the database (e.g. multiply it by 100) in the RadGrid ItemDataBound event.

    2. When the edit form is submitted, there are two scenarios:

    2a) If you are using RadGrid automatic operations, you have to subscribe to the Updating event of the datasource control and modify the submitted percentage value (divide it by 100).

    2b) Otherwise, you have to use the RadGrid OnUpdateCommand and OnInsertCommand events to modify the submitted percentage values before updating the database.


    All the best,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrew
    Andrew avatar
    70 posts
    Member since:
    Oct 2008

    Posted 29 May 2009 Link to this post

    Hi Dimo,

    Thanks for the reply, and yes your solution would work, but again this means that I have to fiddle about in code behind for all such cases.

    In the end it is easier (in this one) to leave the edit as a number (factor), and just display as a percentage on the grid, I am sure the users can get used to this. Then I can wait for a fix.

    If it helps, the ideal fix would be that the editor picks up the Format that has been selected "{0:p4}" and behaves accordingly - i.e. it multiplies by 100, appends a % sign, limits the number fo decimal places to 2 (i.e. 4 when dispalyed divided by 100) and so on. There will need to be a way of overriding this behaviour when the developer wants to allow the user to do something different (e.g. possibly the user is allowed to enter more than 2 (4) decimal places), but in general the format used for display shoudl be the default for editing.

  5. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 29 May 2009 Link to this post

    Hello Andrew,

    Thank you for sharing your opinion. You are right that the Grid should be able to display a percentage number (0 < number < 1) in the same fashion in view and edit mode, so we will develop this behavior for a future version.

    Best wishes,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Kenneth Mazur
    Kenneth Mazur avatar
    18 posts
    Member since:
    Jul 2008

    Posted 17 Sep 2009 Link to this post

    Any update on this?  When I show the RadNumericTextBox on an edit form, it displays the percentage correctly, ie, 6%.  Once it is shown in the RadGrid, it shows up as 600%.  My short term solution is to set the DataFormatString property as follows:

    Dim tBC As New GridBoundColumn
    tBC.DataFormatString = "{0:N2} %"
  7. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 17 Sep 2009 Link to this post

    Hi Kenneth,

    I am afraid this feature has not been implemented yet. It is in our to-do list, but currently we are working on taks with higher priority.

    Greetings,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Robert
    Robert avatar
    1 posts
    Member since:
    Mar 2008

    Posted 11 Feb 2010 Link to this post

    Has there been an update for this?
  9. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 16 Feb 2010 Link to this post

    Hello Robert,

    The feature has not been implemented yet. I have logged it in our public issue tracking system, so that you will be able to track any progress. The PITS item ID is 1038.

    http://www.telerik.com/support/pits.aspx

    Greetings,
    Dimo
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 23 May 2010 Link to this post

    Mmm,

    I reported this over a year and ahalf ago..

    the last reponse
    "Posted on on May 27, 2009 CC:
    Hello Ray,

    Thanks for the feedback, you have raised an interesting point. We will think about it.

    I have updated your Telerik points.

    Greetings,
    Dimo
    the Telerik team "

    The above, simply demonstrates that basic bugs ( this is realy not a feature request, but complience with the dotnet framework) simply does not get done, they seem to want to develop more "new products" rather than fix existing ones..

    Hence, dont hold your breath for a solution.. PITS is simply a nother way of saying we dont want to do anything, so stop asking us to fix bugs..

    Ray

  11. Miguel
    Miguel avatar
    25 posts
    Member since:
    Dec 2010

    Posted 31 Oct 2011 Link to this post

    Hello Telerik Team

    Any updates on this issue?

    Thanks

    Miguel
  12. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 02 Nov 2011 Link to this post

    Hello Miguel,

    We did further research on the issue and I am afraid that we could not change this behaviour.
    You could the workaround discussed before in the second post.

    The limitation comes from the fact that DataFormatString could be something that is not suitable for showing in the edit form and not reversible. For example like:
    DataFormatString="{0:imaginary unit 000 myDecimalSeparator 00 }"
    In this case, you would get properly all values when they are displayed in the grid. However it is expected in the edit form to be able to enter the value exact way as it will be saved in the database. The grid could not know the reverse format (if such exist) that has to be applied for value like:
    imaginary unit 334 myDecimalSeparator 12
    In order to convert it to 334.12 or to 0.33412 or even to 12*2^334 (which would be possible for our imaginary unit.) And because it could not know, the best that the Grid could do is to pass it without change. So it is up to you to change the value manually.

    You probably expect this to work for percents, as they are something common and used daily. However we can't add an exception for the percents, because this will breaks all currently working applications that expects this behaviour.

    All the best,
    Vasil
    the Telerik team
    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
  13. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 02 Nov 2011 Link to this post

    Vasil,
    " I am afraid that we could not change this behaviour"
    This is a joke right?

    Simply implement the work around, or do what 100% of  other dot net controls do..
    I.e implement the dotnet framework, all percentages MUST be 0 ->1 this is how the dotnet framework works, dont make up something which breaks the framework.

    The stuff below is simply waffle..



  14. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 03 Nov 2011 Link to this post

    Hello Ray,

    In the framework itself 0.4 does not mean 40 percents when parsing. The developer who manages the data should know if it works in percents or not. For example the constructor of Unit (which is part of the framework) will not multiply the value, and it will use it as it is in original state:
    Unit u1 = Unit.Percentage(75);
    string u1AsString = u1.ToString(); //u1AsString will be "75%"
    double u1AsDouble = u1.Value; // the value will be "75.0"
     
    Unit u2 = Unit.Percentage(0.4);
    string u2AsString = u2.ToString();//u1AsString  will be "0.4%"
    double u2AasDouble = u2.Value; // the value will be 0.4
    So I believe the Kenneth's solution is best for use in this case. Just store the values in your Database in range from 0 to 100. And using "{0:N2} %" for DataFormatString. This will allow you to edit them in the edit form like percents.

    Best wishes,
    Vasil
    the Telerik team
    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
  15. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 13 Nov 2011 Link to this post

    "In the framework itself 0.4 does not mean 40 percents when parsing"

    I see the problem..
    In the framewerk ( see andrews orignal request)..  percentages are ALWAYS AND ONLY 0->1..
    If you cannot see this than itelerick will never get a solution that works within dotnet..
    Unit has absolutely nothing to do with the issue at hand..

    Just fix the problem, same as 100% of any dotnet controls.. telerik si the only control provider which seems unable to make a simple percentage work in their own grid..

  16. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 14 Nov 2011 Link to this post

    Hi guys,

    Let me clarify what options you have for representing your percentages in RadGrid:

    1. Specifying DataFormatString in your GridNumericColumn settings:

    DataFormatString="{0:p2}"

    This property is only used when formatting the visible values in read-only cells. A database value of 0.52 will be displayed as 52.00% in the non-editable cells of the numeric column. The property does not affect the RadNumericTextBox instance rendered in the edited items.

    2. Specifying NumericType in your GridNumericColumn settings:

    NumericType="Percent"

    This property affects only the numeric textbox in the edit form when you specify Percent. Using this setting, RadNumericTextBox will show a percent sign in the numeric field without modifying the original value. A database value of 0.52 will display as 0.52 % if you have specified NumericType="Percent", and will stay as 0.52 if you use the default value (NumericType="Number").

    3. Implement a custom column that will take care of the percent conversion and will allow your users to enter a value between 0 and 100. When extracting the value from the column, the former will be returned as a floating point value between 0 and 1. This is easier than you might think. We need to subclass GridNumericColumn to set a few required settings, and then subclass GridNumericColumnEditor to setup the numeric textbox correctly. The complete source code of this custom percent column is attached. Including it in your grid is very easy. First register your namespace:

    <%@ Register Namespace="GridCustomColumns" TagPrefix="grid" %>

    And then use your percent column just like any other column:

    <telerik:RadGrid>
        <MasterTableView>
            <Columns>
                <grid:GridPercentColumn>
                </grid:GridPercentColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    The result is a percent column that displays values from 0 to 1 as integers from 0 to 100 and also allows users to enter values from 0 to 100 keeping the conversion transparent.


    Veli
    the Telerik team
    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
  17. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 14 Nov 2011 Link to this post


    "RadNumericTextBox will show a percent sign in the numeric field without modifying the original value. A database value of 0.52 will display as 0.52 % if you have specified NumericType="Percent",

    Good description of the issue and defect..
    In order to amke any grid work, one need to sue the framework 0->1 stanadrd..
    If one uses your percentage control within Your grid, one gets the wrong displayed value as you demonstate above.
    FULL STOP..

    Been over a year and no progress on this basic defect..




  18. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 15 Nov 2011 Link to this post

    Have you tried the custom column I have provided in my previous post? I believe it solves the issue you are describing and you can use that in your project.

    Veli
    the Telerik team
    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
  19. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 15 Nov 2011 Link to this post

    Thanks but you mis understand..

    I just want the controls to work out fo the box, i.e percentage control with your grid..
    Very basic stuff..

    I have been hacking up fixes.. for this defect for many years ARG!!
    You suggestion is just another of the many..
    JUST FIX IT... once and for all; to save us ALL a lot of work fixing your broken control on each and evry page we use it..




  20. Callum
    Callum avatar
    5 posts
    Member since:
    Dec 2010

    Posted 15 Nov 2011 Link to this post

    Hi,

    This issue is also causing me a major headache.  I have tried your example custom column class and it breaks when I try to do a postback.  I have an example application that I would like to attach, however this thread won't let me do that, so here is the stack trace for the exception I get:

    [GridException: Cannot create column with the specified type name: GridPercentColumn] Telerik.Web.UI.GridColumnCollection.CreateColumnFromTypeName(String columnTypeName) +1520 Telerik.Web.UI.GridColumnCollection.System.Web.UI.IStateManager.LoadViewState(Object savedState) +434 Telerik.Web.UI.GridTableView.LoadStructureState(Object SavedStructure) +366 Telerik.Web.UI.RadGrid.LoadTableViewStructure(IEnumerator stateEnumerator, GridTableView tableView) +101 Telerik.Web.UI.RadGrid.LoadViewState(Object savedStateObject) +281 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +187 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225 System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148 System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225 System.Web.UI.Page.LoadAllState() +312 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +747 



    I have to say after reading the history of this issue I'm appalled with Telerik's handling of it.  I agree with Ray, the behavior of this control should be consistent with the globally accepted standard - not only for that reason, but more importantly because we can't use percentage-based columns consistently between edit mode and read-only mode.  Let me explain our situation:

    We are in the process of trialling an upgrade of our application from the Classic RadControls to the latest Prometheus controls (on .NET 4).  Previously with the Classic controls, all we had to do was set the DataFormatString property on the GridBoundColumn object and the formatting would be consistent between edit mode and read-only mode.  Now in the new controls that behavior has been stripped and the DataFormatString is no longer applied when in edit mode.  This has been brought up in a previous post (see here) and answered such that we should apply the data format string manually to every grid in the application through the grid's ItemDataBound event - a stupid idea given that we probably have 50+ grids in our application which would need this change.

    The suggested alternative to this is that we use GridNumericColumn.  This would be an acceptable solution, however when using Percent as the numeric type there is now an inconsistency between how the datasource needs to present values between edit mode and read-only mode.  Obviously our datasource can't be aware of what mode the grid cell is in so we would have to intercept this in the grid itself (again a stupid solution given the amount of grids we have in the application, and just shouldn't be necessary!!).

    So finally Telerik provide a solution in the form of a custom column (which at the moment doesn't work) that in most developers minds would be considered a hack.  Say this solution does eventually work, this extra code now becomes code that is now managed by us.  What happens when Telerik make a change to the product which breaks this code?  I can be sure that Telerik's response will be that this code - although provided by them - is not part of the product so is not supported.  I mean what is the point in having a 3rd party product if we have to write custom code to fix deficiencies in the product??!!!

    These comments are intentionally emotive, but have been seriously toned down from how I actually feel. For myself and the rest of the development community, that up until now have had nothing but praise for Telerik, a workable and sensible solution must be provided for this issue to restore our faith and continued use of this solution. Telerik team....over to you.
  21. Callum
    Callum avatar
    5 posts
    Member since:
    Dec 2010

    Posted 15 Nov 2011 Link to this post

    Ignore this post, your server throws errors even when a post does work so this turned out to be a duplicate of my other one.  Oh and can I suggest that on your error page you don't say "Cheer up and get a free trial" when it's your free trial that's hacking me off in the first place.
  22. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 16 Nov 2011 Link to this post

    Hi Callum,

    We cannot reproduce the error you have reported. We would surely like to look into this issue, if you manage to reproduce it again. If you can share some more info on your particular grid setup and column usage, we may be able to identify what's wrong.

    As for "fixing" the numeric column, note that this would be a major breaking change affecting users that are already using the current column behavior. Instead, a property (turned off by default) can be introduced to alter the column behavior and use values from 0 to 1 for representing percentage.

    In any case, you guys definitely have a say in what we build. I have notified the development team of this conversation and I believe they will consider your opinion. Additionally, I have created a PITS item for this feature where you guys can vote. Note that voting for this feature is important for us and is an effective way of influencing the decision to implement.

    Veli
    the Telerik team
    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
  23. Callum
    Callum avatar
    5 posts
    Member since:
    Dec 2010

    Posted 16 Nov 2011 Link to this post

    Hi Veli,

    Thanks for your reply.  I've created a separate thread so that I am able to upload my example application which reproduces the issue I'm experiencing with your sample GridPercentColumn, see the following link:

    http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=483791

    I understand that Telerik can't simply change the code and break existing uses, so the suggested solution of adding a PercentType property to the GridNumericColumn class is perfectly acceptable.  Thank you for moving this issue into the PITS area so it can be voted, but until either this development is done or the GridPercentColumn example works, we have no acceptable solution to this problem and as a result will not be upgrading from Classic to Prometheus (which also prevents us from upgrading from .NET 2 to 4!).

    I notice that this issue has previously been moved there as item 1038 (mentioned here).  I'm unable to find this item in PITS and am wondering what votes it previously had.  Will the votes added to this previous item also count towards the new PITS item?

    Regards
    Callum
  24. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 17 Nov 2011 Link to this post

    Hi Callum,

    The previous issue seems to have been removed from PITS due to getting insufficient interest. It got one vote which we can add to the votes of this newly created PITS item.

    As for your issue with the custom column, you are creating your columns programmatically in the Page_Load method of the page. When creating custom column programmatically, you need to use RadGrid's ColumnCreating event to create new instances of custom columns on postback:

    protected void EmployeeGrid_ColumnCreating(object sender, GridColumnCreatingEventArgs e)
    {
        if (e.ColumnType == "GridPercentColumn")
        {
            e.Column = new GridPercentColumn();
        }
    }

    Using that event, RadGrid can now properly initialize your custom column. This should fix the problem.

    Veli
    the Telerik team
    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
  25. Callum
    Callum avatar
    5 posts
    Member since:
    Dec 2010

    Posted 17 Nov 2011 Link to this post

    Hi Veli,

    I see, that may be the case but again that puts us in the position of having to write code into every grid in the application to resolve this problem - a situation that is unacceptable to us (as I have already said).  It seems to be a common theme in many of the posts I've seen in this forum, that the suggested solution for fixing problems with the grid is for the developer to patch it up by implementing some code in a grid event.  Is it not recognized by Telerik that whenever this is required, that the developer may have to go through every grid in their application and do this?  Do you realize how much pain that causes your community of developers?  In my mind this is not acceptable practice and I question whoever is architecting this stuff as to whether they understand this.  PLEASE provide a solution where I don't have to write code into every grid in my application.  Until this happens we are not prepared to upgrade from the Classic controls and will have to look for a product that understands this simple concept.

    Regards

    Callum

  26. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 18 Nov 2011 Link to this post

    PLEASE provide a solution where I don't have to write code into every grid in my application.

    Currently, any solution we may provide involves writing some amount of code in every grid. If the dev team decides to implement the proposed approach, there will be a single property you will have to set in each percentage formatted GridNumericColumn.

    Veli
    the Telerik team
    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
  27. Callum
    Callum avatar
    5 posts
    Member since:
    Dec 2010

    Posted 20 Nov 2011 Link to this post

    I understand your point but actually with the way we have written our application that won't be necessary for us if your dev team implements this feature.  In our application, the users are able to configure exactly what fields will appear on any grid they can see.  Because of this, when our code builds a grid on a screen, it uses central logic that reads this configuration and determines what value to apply to the various properties (DataType, DataFormatString, HeaderText, ReadOnly etc) for each column.  Currently that code looks something like this:
    public void SetGridColumns(RadGrid grid, GridConfig gridConfig)
    {
        foreach (GridAttribute gridAttribute in gridConfig.GridAttributes)
        {
            this.AddGridBoundColumn(grid, gridAttribute);
        }
    }
     
    protected void AddGridBoundColumn(RadGrid grid, GridAttribute gridAttribute)
    {
        GridBoundColumn gridColumn = new GridBoundColumn();
        grid.MasterTableView.Columns.Add(gridColumn);
     
        gridColumn.UniqueName = gridAttribute.ID;
        gridColumn.HeaderText = gridAttribute.SoftName;
        gridColumn.DataType = gridAttribute.GetType();
        gridColumn.DataField = gridAttribute.ID;
        gridColumn.DataFormatString = gridAttribute.DataFormatString;
    }

    So what we do for each grid we put on a form is turn off the AutoGenerateColumns property and instead call the above SetGridColumns method (which resides in a class called GridBinder that is accessible to all web forms) from the non-postback section of the Page_Load event.

    With the proposed change (and after upgrading from Classic to the new version of RadControls) the code would look more like this:
    public void SetGridColumns(RadGrid grid, GridConfig gridConfig)
    {
        foreach (GridAttribute gridAttribute in gridConfig.GridAttributes)
        {
            this.AddGridBoundColumn(grid, gridAttribute);
        }
    }
     
    protected void AddGridBoundColumn(RadGrid grid, GridAttribute gridAttribute)
    {
        GridBoundColumn gridColumn = null;
        if (gridAttribute.GetType() == typeof(decimal))
        {
            gridColumn = new GridNumericColumn();
        }
        else
        {
            gridColumn = new GridBoundColumn();
        }
        grid.MasterTableView.Columns.Add(gridColumn);
     
        gridColumn.UniqueName = gridAttribute.ID;
        gridColumn.HeaderText = gridAttribute.SoftName;
        gridColumn.DataType = gridAttribute.GetType();
        gridColumn.DataField = gridAttribute.ID;
        gridColumn.DataFormatString = gridAttribute.DataFormatString;
     
        if (gridColumn is GridNumericColumn)
        {
            GridNumericColumn numericColumn = gridColumn as GridNumericColumn;
            switch (gridAttribute.DataType)
            {
                case DataTypeEnum.Percentage:
                    numericColumn.NumericType = NumericType.Percent;
                    numericColumn.GridPercentType = GridPercentType.FloatingPoint;
                    break;
                case DataTypeEnum.Money:
                    numericColumn.NumericType = NumericType.Currency;
                    break;
                case DataTypeEnum.Decimal:
                    numericColumn.NumericType = NumericType.Number;
                    break;
            }
        }
    }

    Hopefully you can now see that with this type of solution we wouldn't need to write code into every grid of the application to resolve this problem.
  28. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 21 Nov 2011 Link to this post

    Understood. Dev team is getting the feedback. It all depends on the PITS voting now.

    Veli
    the Telerik team
    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
  29. matt
    matt avatar
    259 posts
    Member since:
    Oct 2007

    Posted 09 Sep 2013 Link to this post

    Telerik,

    I came across this post while researching the same exact problem -- this is a bug. Percentages are often stored in 0-1 format in .NET and our underlying SQL db. It makes zero sense to have the RadNumericColumn have a NumericType="Percent" mode that simply shows a "%" sign. I'm forced to use the 0:p2 dataformatstring property...but this doesnt help on edit/filter textboxes, which for filtering improperly require one to type in this:

    .95 %

    ...when trying to filter on 95 %, as the grid shows when using 0:p2 format.

    It's a bug. It should have been fixed years ago. I'm disappointed that it hasn't.
  30. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 10 Sep 2013 Link to this post

    Hello matt,

    Few releases ago we had introduced the DbValueFactor property of both RadNumericTextBox and GridNumericColumn. It should do the trick in your case.
    Set DbValueFactor=100 for your column. And when you bind to database value like 0.15 it will be seen in the numeric text box as 15.
    By default the factor is 1.

    Regards,
    Vasil
    Telerik
    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 the blog feed now.
  31. Mike
    Mike avatar
    11 posts
    Member since:
    Jul 2010

    Posted 01 Aug 2014 in reply to Vasil Link to this post

    DbValueFactor does not get applied to edit/filter textbox values, so its still necessary to filter on 0.95 to find values displayed in the grid as 95 % when filtering. Annoying and a bug as has been pointed out in this thread many times.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017