in

C1 Community

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

Multiple Column Sortation

Last post 06-27-2008 4:36 PM by iddjoe. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-27-2008 11:16 AM

    Multiple Column Sortation

     I've got a flexgrid that I fill as follows:

             fgCustomers.DataSource = Customers.dtCustomers();
             fgCustomers.Cols["CUSTID"].Visible = false;
             fgCustomers.Col = -1;

    Afterwards, the user needs to be able to sort based on multiple columns (such as Active, Company, Contact, etc.).

    It works fine when "AllowSorting" is set to "Single Column", but when it is set to "MultiColumn" it doesn't sort at all. What am I missing? Do I have to implement my own code for this to work???

    I'm using VS 2008.

  • 06-27-2008 2:29 PM In reply to

    Re: Multiple Column Sortation

    If you want to do multi column sorting you will need to set sort property of columns and then call Sort method of grid.

     

    Such as -

    -------------------------------

    Me.C1FlexGrid1.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.MultiColumn

     

    Me.C1FlexGrid1.Cols(1).Sort = C1.Win.C1FlexGrid.SortFlags.Ascending

    Me.C1FlexGrid1.Cols(2).Sort = C1.Win.C1FlexGrid.SortFlags.Descending

     

    Me.C1FlexGrid1.Sort(C1.Win.C1FlexGrid.SortFlags.UseColSort, 1, 2)

    --------------------------------

     

    I hope this helps.

     

    -Dave.

     

    <iddjoe> wrote in message news:206509@10.0.1.98...

     I've got a flexgrid that I fill as follows:

             fgCustomers.DataSource = Customers.dtCustomers();
             fgCustomers.Cols["CUSTID"].Visible = false;
             fgCustomers.Col = -1;

    Afterwards, the user needs to be able to sort based on multiple columns (such as Active, Company, Contact, etc.).

    It works fine when "AllowSorting" is set to "Single Column", but when it is set to "MultiColumn" it doesn't sort at all. What am I missing? Do I have to implement my own code for this to work???

    I'm using VS 2008.



    http://helpcentral.componentone.com/cs/forums/p/75715/206509.aspx#206509

  • 06-27-2008 4:36 PM In reply to

    Re: Multiple Column Sortation

     So I can't just let my users make their own sortation method???

     What if Sue likes to view the companies alphabetically, grouped into states; bob prefers to view his companies alphabetically based on who is an active client; and jim likes to view the contact names grouped by state with all of the active companies first...

     How do I enable something like that??? I don't want to hard-code the multi-column sortation.

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