CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Posts
    568

    Sorting GridView control

    How can i sort the GridView control by clicking the column header?

  2. #2
    Join Date
    Apr 2009
    Location
    Bahamas
    Posts
    33

    Lightbulb Re: Sorting GridView control

    Are you using DataGridView, or is GridView a seperate control?

    The DataGridView should sort itself when clicking the headers, if it doesn't try looking for an event for "column header click" or something similar and put your code in there. Try looking at the properties of the DataGridView control to see if you have sorting turned off, or clickable headers turned off.
    Thanks,
    - pgrammer

  3. #3
    Join Date
    Feb 2005
    Posts
    568

    Re: Sorting GridView control

    Quote Originally Posted by pgrammer View Post
    Are you using DataGridView, or is GridView a seperate control?

    The DataGridView should sort itself when clicking the headers, if it doesn't try looking for an event for "column header click" or something similar and put your code in there. Try looking at the properties of the DataGridView control to see if you have sorting turned off, or clickable headers turned off.
    i'm using GridView control, i have set those sorting property to true.... but when i click on the header it ask for handler of the sorting... i have create the handler but don't know what should write in the handler...

    can anyone can provide me sample??

  4. #4
    Join Date
    Apr 2009
    Location
    Bahamas
    Posts
    33

    Re: Sorting GridView control

    Quote Originally Posted by lsy View Post
    i'm using GridView control, i have set those sorting property to true.... but when i click on the header it ask for handler of the sorting... i have create the handler but don't know what should write in the handler...

    can anyone can provide me sample??
    http://www.google.com/search?hl=en&q...q=sorting+data
    http://www.google.com/search?hl=en&q...ly&btnG=Search
    http://social.msdn.microsoft.com/Sea...ng%20c%23&ac=1
    Thanks,
    - pgrammer

  5. #5
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Sorting GridView control

    Quote Originally Posted by lsy View Post
    i'm using GridView control, i have set those sorting property to true.... but when i click on the header it ask for handler of the sorting... i have create the handler but don't know what should write in the handler...

    can anyone can provide me sample??
    Maybe you show your code reagrding that control se we can show you the adequat code for your grid
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

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

Featured