Results 1 to 4 of 4

Thread: datagridview datatable bool won't sort

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question datagridview datatable bool won't sort

    Any reason why string, int, etc. will sort but bool will not?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: datagridview datatable bool won't sort

    Assuming that you're simply binding data to the grid and letting it create its own columns, the answer is in the documentation for the DataGridViewCheckBoxColumn:
    The default sort mode for this column type is NotSortable.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: datagridview datatable bool won't sort

    Quote Originally Posted by jmcilhinney View Post
    Assuming that you're simply binding data to the grid and letting it create its own columns, the answer is in the documentation for the DataGridViewCheckBoxColumn:
    Peculiar...well then again, it is Microsoft.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: datagridview datatable bool won't sort

    I would guess that the reason is that there's nothing inherent in the values True and False to indicate that one is more or less than the other. True and False are represented internally by numbers are will therefore be sorted in numerical order when sorted and you can opt for that behaviour if you want but there is logic to not "sorting" by default. It really only makes sense to "group" values, you can do manually or automatically if you choose.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width