Skip to content

Replies

0
Victor
Victor answered on Jun 18, 2013 1:22 PM

Great thx Boris.  Yep, I found this page quite useful.

0
Victor
Victor answered on Jun 18, 2013 1:20 PM

Thx Mike, that's what I ended up with it works great.  I figured I needed a place to store the formatted (string) and raw (numeric) values and couldn't figure out how to do that with just the 1 "Value" cell property or bound dataset cell value, so I actually added a numeric sorting col (and hid it) and pointed to that col in the "Compare()" method I'd assigned to the "display" col version. 

I had 1st gone down the path of using a 2-element string array ([0]=display value and [1]=raw numeric value) for the bound dataset col value that had display and raw properties so I could display the display value and sort on the raw numeric value.  I then tried using "BeforeSortChanged" event where tried to replace "SortedColumns" with the hidden numeric cols to sort on them that way.  I then went the route of using "ExternalSortSingle", where I left the raw numeric value in the underlying dataset, sorted that, then handled display via code.  Then I realized I could just refer to the hidden numeric cols for sorting as the subject of my compares in right in the "Compare()" method, so I went with that.

0
Victor
Victor answered on Jun 17, 2013 6:31 AM

Hi Mike, I'm trying to do the same thing, but am confused about distinguishing between/specifying different values for display vs underlying value for a column.  I'm not using drop-downs, so not sure if "ValuerList" applies for me.  My data source is a ADO.Net DataSet; I want to show a textual format for a numeric value, but sort on the raw numeric value when the col header is clicked.  I believe I can use "SortComparer", but seems like all I could do is grab the display text and somehow try to get back to the raw numeric form for the comparison and I'd rather just store the discrete numeric/display values somewhere and directly reference in "SortComparer".  Thx!