Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Listview control on date

Status
Not open for further replies.

vdeveloper

Programmer
Aug 5, 2000
42
IN
I am using Listview control combined with a treeview control on my main form. Ive implemented code to sort the listview.<br>Problem is The listview control is not sorting the date column correctly. It sorts the date characterwise i.e 03/06/2000, 03/07/2000, 04/06/2000 etc..<br><br>Please help<br><br>Thanks in advance.
 
add another column that is julian date, and sort by that, but don't display it in the list.&nbsp;&nbsp;Or you could change your format to YYYY/MM/DD.&nbsp;&nbsp;<b>Is the data type for your dates strings or dates?</b> <p> <br><a href=mailto:blindpete@mail.com>blindpete@mail.com</a><br><a href= > </a><br>
 
Hi Blindpete<br><br>Sorry for not responding. was away<br><br>the data type for dates is date in the format dd/mm/yyyy which is what we use in India. I need to display document no. date and amount from my date file in my listview with sorting enabled on all columns. I dont seem to get the date column to sort properly as I mentioned earlier. how can I add a column to the listview and not display it?<br><br>Thanks in advance
 
You can add a column to a list (or combobox) by including it in whatever builds the RowSource for the list (a SELECT statement, for example), and not display it by ensuring the BoundColumn property is set to 1, and setting the ColumnWidths property to something wide enough so the second one doesn't show (i.e. 200,1 sets the first column's width to 200 pixels and the second to 1 pixel).&nbsp;&nbsp;These values assume your form's ScaleMode is Pixels. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Thanks everyone for your responses.

I think I have not clarified that I am using The Listview ActiveX control and not a native listbox control here. I have implemented code to sort the listview in the columnclick event. The problem of date sorting still remains as I mentioned above.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top