This question is locked. New answers and comments are not allowed.
I have a RadGridView and a ViewModel. Among the requirements is that the user can change the current unit for the data reported in the Grid. I.e., the base unit might be in bytes, and they user can request KB, MB, GB, etc. Right now when they do this, I recompute the bound values by appropriate division. Unfortunately, this causes a few problems.
1. The Sum aggregate functions (row totals) are no longer accurate since they are summing scaled values at reduced resolution
2. Export to CSV uses the new values, again losing resolution.
Ideally, I'd like to keep everything in bytes, except have (the equivalent of) a DataFormatString which overrides the display in the Grid only. In the past (i.e., a format string that says 'convert to GB'.) I've asked for computer-storage sizes in the graphing controls and there wasn't enough interest to get that done. This is similar.
Further complicating things is that all the columns are generated using the Lightweight DataTable trick you recommended so while I can write a template (in XAML), it has no idea what the binding should be - I get the object with its 15 generated properties but I don't know which property goes in the current column - but I can use an IValueConverter to do the scaling.
Any suggestions to an approach that works well, and allows me to change the divisor on the fly (I'm OK with generating a whole new DataContext/ViewModel and switching it in) would be extremely helpful!
Thanks,
Tim
1. The Sum aggregate functions (row totals) are no longer accurate since they are summing scaled values at reduced resolution
2. Export to CSV uses the new values, again losing resolution.
Ideally, I'd like to keep everything in bytes, except have (the equivalent of) a DataFormatString which overrides the display in the Grid only. In the past (i.e., a format string that says 'convert to GB'.) I've asked for computer-storage sizes in the graphing controls and there wasn't enough interest to get that done. This is similar.
Further complicating things is that all the columns are generated using the Lightweight DataTable trick you recommended so while I can write a template (in XAML), it has no idea what the binding should be - I get the object with its 15 generated properties but I don't know which property goes in the current column - but I can use an IValueConverter to do the scaling.
Any suggestions to an approach that works well, and allows me to change the divisor on the fly (I'm OK with generating a whole new DataContext/ViewModel and switching it in) would be extremely helpful!
Thanks,
Tim