Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem sorting in MSHFLEXGRID

Status
Not open for further replies.

Draven74

Programmer
May 30, 2001
13
0
0
CA
Hello,

I'm hoping somebody can help me out. I'm using the double click event of an MSHFLEXGRID to sort a column selected by the user. I have multiple columns with different data types (dates, integers, strings). The problem is that whatever sort property I choose, it doesn't sort all data types correctly. It might work on integers, but then it doesn't work on alphanumeric strings, or it works on dates, but not integers. I haven't been able to find one sort property that encompasses all data types (not even the generic sorting). I'd appreciate any help on the matter.
Thanks.
 
Hi

Do you require the sort property used to depend on the column which is double-clicked.

If so, could you set the sort property, from the double_click event, based on the currently selected column?

Regards

sadcow
 
If each column constains the same kind of data,
I'd store each column in an array. When the appropriate column was double-clicked, I chose the appropriate sort routine for the specific column.
 
I don't think you'll find a general sort function to serve your purpose. Can't you just determine the data type then use the appropriate sort? Then, apply the permutation vector that it returns to your other columns.
 
Thank you all for your input. I'm trying to make this as generic as possible. I wanted to avoid using an array or collection. I'm dealing with multiple grids (each with many columns). I'm probably dreaming in technicolor, but does anyone know of a property of the MSHFLEXGRID that can return the data type of a selected column?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top