Jump to content


Photo

NextGrid Disable Sorting


  • Please log in to reply
5 replies to this topic

#1 Afiag

Afiag
  • Members
  • 117 posts

Posted 11 January 2006 - 03:08 PM

How do I disable sorting on a NextGrid ? (So that clicking the header doesn't filter A-Z/Z-A anymore

#2 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 11 January 2006 - 04:07 PM

Hi

Have you tried to set coCanSort to false in each unsortable column's options?
G.W. van der Vegt

#3 Afiag

Afiag
  • Members
  • 117 posts

Posted 11 January 2006 - 04:20 PM

Thanks

#4 littlebigfred

littlebigfred
  • Members
  • 176 posts

Posted 08 September 2009 - 04:08 PM

Is there a way to disable sorting on the entire grid, instead of just disable sorting for each column?

CODE
With Frame31.NextGrid1 do begin
    //How to disable sorting?

    Columns.Add(TNxTextColumn,'SQL');
    Columns[0].Options := Columns[0].Options - [coCanSort];
    
    Columns.Add(TNxTextColumn,'Paramètre');
    Columns[1].Options := Columns[1].Options - [coCanSort];
    
    Columns.Add(TNxTextColumn,'Valeur');
    Columns[2].Options := Columns[2].Options - [coCanSort];
end;


And is there a way to set options more efficiently than eg.

CODE
Columns[0].Options := Columns[0].Options - [coCanSort];
Columns[0].Options := Columns[0].Options + [coFixedSize];



Thank you.

#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 08 September 2009 - 05:26 PM

Hello Fred,

Unfortunatelly, this option doesn't exist. Only way is to you write small for loop and add/remove coCanSort flag from all columns.

If you don't know how to write it, I may help.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 littlebigfred

littlebigfred
  • Members
  • 176 posts

Posted 08 September 2009 - 07:23 PM

It's OK, I was already using a loop. I was checking to see if there were a shorter way to disable sorting on all columns.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users