hi,
let's say we have the following columns:
account name (ex: Mega Design) << string
created on (ex: 15) << integer
description (ex: 15 days ago) << string
if we click on account name column header, the grid sorts the column asc/desc according to its datatype (in this case string).
if we click on (description) column header, it will will sort the column as a string (15 days ago).
now, i want to hide (created on) column and keep (account name, description)
and make clicking on description sorts the grid as an integer...as if we have clicked on (created on)).
is that possible?
Hi,
Yes, this is actually pretty easy. There is a SortComparer property on the UltraGridColumn. So this allows you to customize the sorting of any column however you want. In this case, it's even easier, because you aren't doing any complex sorting, you just want to re-direct the sorting of one column to use the values from another column.
I have attached a small sample project that sorts a string column ("String 1") by the value of an integer column ("Int32 1").
Can you post the code here? I'm unable to open the file.
Hi Mr. saltzman,
that's EXACTLY what i wanted, it works like a charm.
thanks a lot.