in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Sorting unbound and datamap columns in a bound flexgrid

Last post 02-18-2008 3:01 PM by paarothefinc. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-13-2008 4:19 PM

    Sorting unbound and datamap columns in a bound flexgrid

    Hi all,

    i use bindingSource, which i bind to flexgrid (its datasource). one of bound columns has datamap defined, which convert IDs, stored in that column, to proper text. i also have one unbound column (manually added in code), where i do some calculations (via flexgrid's getunboundvalue event handler). so far so good. both columns display proper data. but sorting is where troubles begin. all bound columns sort ok, but the one with datamap defined sorts according to IDs, stored in that column, not text, translated via datamap. and the other problem is unbound column, which doesn't sort at all. i tried with beforesort event handler (with grid's sort method and icomparer implementation), but it doesn't work.

    my question: is it possible to properly sort bound columns with datamap defined and is it possible to sort added unbound columns at all?

    tnx!

    peter 

  • 02-15-2008 4:14 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 500

    Re: Sorting unbound and datamap columns in a bound flexgrid

    >> is it possible to properly sort bound columns with datamap defined and is it possible to sort added unbound columns at all?

    Since sorting is done on the datasource, the mapped values are not included and neither is the unbound column.  A workaround to sorting the datamap is to add an invisible column containing the mapped values.  Then handle sorting by this column when the user tries to sort the mapped column.  To sort the unbound column you can first add the column to the DataSet thus making it bound.

    hope that helps some
    Greg

  • 02-18-2008 3:01 PM In reply to

    Re: Sorting unbound and datamap columns in a bound flexgrid

    all in all, it seems that using binding is nothing but trouble (if you have to use special (computed, translated, etc) columns. maybe it is better to fill flexgrid manually and then implement sorting. thank you very much for answering!

     peter
     

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.