Re: Database Listing and Sorting
From: Paul S. Ganney (paul.ganney_at_hey.nhs.uk)
Date: 08/20/04
- Previous message: Ralph Krausse: "Questions on SQLXML"
- In reply to: Jeff: "Database Listing and Sorting"
- Next in thread: Jeff: "Re: Database Listing and Sorting"
- Reply: Jeff: "Re: Database Listing and Sorting"
- Messages sorted by: [ date ] [ thread ]
Date: 20 Aug 2004 03:54:20 -0700
"Jeff" <Jeff@discussions.microsoft.com> wrote in message news:<07C743BB-C14B-406B-B3CC-7118C34AC7AF@microsoft.com>...
> Hello all,
> (Note: I am a rookie and just filling in)
>
> I was wondering if someone could give some quick advice on how to modify the
> way a List Control Box (IDC_RECORDS) displays the records in a list. As they
> currently are, the list displays the records, but some of the columns are
> short, some are long. A few columns are too long and push the others that
> are need out of view. Also, there is no way to 'sort' the results displayed
> either, but the user can change the width of the columns.
>
> This is coming from an Access database using ODBC so the 'GetRecord'
> commands are written in SQL statements.
>
> Here is a code example:
>
> m_records.InsertColumn(0,"Rec",LVCFMT_RIGHT,1,2);
> m_records.InsertColumn(0,"Total Amount",LVCFMT_RIGHT,100,2);
> m_records.InsertColumn(0,"Vendor Name" ,LVCFMT_RIGHT,350,1);
> m_records.InsertColumn(0,"Purchase Order Number" ,LVCFMT_RIGHT,200,0);
> m_records.InsertColumn(0,"Order Date" ,LVCFMT_RIGHT,100,0);
>
> My guess is that if I adjust some of these numbers (100,0) that I could
> shorten the display. Anyone's help would be greatly appreciated.
The "100" is the number to change as that's the width of the column.
Rather than sorting the data after it's arrived, why not get the
database to do it for you? If you're using CRecordSet-derived classes,
then all you do is set the m_strSort parameter.
HTH
Paul.
- Previous message: Ralph Krausse: "Questions on SQLXML"
- In reply to: Jeff: "Database Listing and Sorting"
- Next in thread: Jeff: "Re: Database Listing and Sorting"
- Reply: Jeff: "Re: Database Listing and Sorting"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|