Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Summary : Get Maximum Decimal Value Only
posted

Hi,

I have some Text (VARCHAR) Columns in the grid. but these columns also contain decimal and null values. When I tried to get the Maximum/Minimum values it shows the Text value. I want to show the decimal values only for Max/Min summary click.

Please guide me on how can I do this? Thanks

Parents
  • 469350
    Verified Answer
    Offline posted

    Storing decimal or any numeric values in a string column is a really bad idea. This is going to cause you all sorts of problems. Sorting will not work correctly, filtering will not work correctly, and as you have experienced, summaries don't work in an ideal manner. 

    The only way I can think of to make this work is to hide the "real" column and replace it with an unbound column that is if type Decimal. This column will copy the decimal values from the "real" hidden column and leave the string cells blank. that way the summaries will work correctly. Of course, that leaves the problem of the blank cells, but you could handle those using a DrawFilter to simply draw the text on the screen even though it's not actually contained in the cell's Value. I have attached a small sample project here demonstrating this technique. 

    This will not work if the user can edit the cells, though, because when they go into edit mode, the text will disappear and there's no way to make that work as far as I can see.

    If your summaries are fixed and you are not allowing the user to choose them, then you could take another approach, which would be to create your own custom summary calculator. But that won't match up with the checkboxes in the summary dropdown UI, so that will not work if you are showing the dropdown and letting the user pick their own summaries.



    3250.MemDataTable CS.zip

Reply Children
No Data