Crash when adding filter on a calculated column

2 posts, 0 answers
  1. Richard
    Richard avatar
    2 posts
    Member since:
    May 2015

    Posted 02 Sep 2015 Link to this post

    # Context
    - Using RadGridView
    - Having a column named "MyDataColumn", which contains different decimal values, including zero.
    - Using UI, add filter on "MyDataColumn" : "Greater than: 0"
    - Added a calculated column named "MyCalculatedColumn", using expression "MyDataColumn / MyDataColumn".
    - Note that, at this point, it doesn't crash since we added the "Greater than: 0" filter on "MyDataColumn" ... without that filter, it will crash, as we all know division by zero is impossible.

    # Behavior
    - Using UI, add a filter on "MyCalculatedColumn"
    - Application crash
  2. Dess
    Dess avatar
    1561 posts

    Posted 07 Sep 2015 Link to this post

    Hello Richard,

    Thank you for writing.
    When you use a calculated column, note that you should set a valid expression. Hence, you should avoid division by zero. When the expression is correct, no error occurs on my end with the specified version. Here is my sample code snippet. The attached gif file illustrates the behavior on my end:
    private void Form1_Load(object sender, EventArgs e)
        GridViewDecimalColumn col = new GridViewDecimalColumn("Calculated Column");
        radGridView1.Columns["Calculated Column"].Expression = "IIF(ReorderLevel > 0, ReorderLevel/ReorderLevel, 0)";
        this.radGridView1.EnableFiltering = true;

    I have attached my sample project as well. If you are still experiencing any further issues, please specify the exact steps how to reproduce the problem with the provided project. Thus, we would be able to investigate the precise case and assist you further. Thank you.

    Should you have further questions I would be glad to help.
    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 Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top