Results 1 to 2 of 2

Thread: Sorting by Unbound column

  1. #1

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    Sorting by Unbound column

    Hi everyone. Again.

    I'm using Microsoft Access 2003, an OleDb connection and Visual C# 2005.

    I'm using a mostly databound datagridview, with a single unbound column called "status". In my code, I compare a number of columns in the grid view, return a string, and fill in the unbound status column with that string.

    The only real reason I'm doing this is so that the user can sort the datagridview by this string. In all the other columns, I can click the column header to sort them. Unfortionately, for some reason doing the same on the unbound column has no effect.

    Any help would be appreciated. Thanks.
    "Why do all my attempts at science end with me getting punched by batman?" xkcd.

    |Pong||
    Sorry for not posting more often.

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

    Re: Sorting by Unbound column

    This is not a database question. It's a pure VB question and should have been asked in the VB.NET forum.

    You simply have to sort your grid programmatically. I suggest that you read the MSDN documentation for the DataGridViewColumn.SortMode property and follow the appropriate links from there.

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