KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

ListView Sorting - Cont
Goto page Previous  1, 2
 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Aug 01, 2007 3:20 pm    Post subject: Reply with quote

Here's a quick script for testing ... the next build will have the SortType property so that strings that are numbers will sort properly. I'm trying to be "carefull" with these changes because the existing method of sorting has to still work.

Code:

Break On

$System = CreateObject("Kixforms.System")

;
; Form
;

$Form = $System.Form()
$Form.ClientWidth = 640
$Form.ClientHeight = 480

;
; ListView
;

$ListView = $Form.Controls.Add($System.ListView())
$ListView.View = $System.View_Details
$ListView.FullRowSelect = 1
$ListView.HideSelection = 0
$ListView.MultiSelect = 0
$ListView.Dock = $System.DockStyle_Fill

; Columns

$NameColumn = $ListView.Columns.Add("Name")
$NameColumn.Width = 120

$AgeColumn = $ListView.Columns.Add("Age")
$AgeColumn.Width = 100

$SalaryColumn = $ListView.Columns.Add("Salary")
$SalaryColumn.Width = 100

; Data

For $i = 1 To 100
 $Item = $ListView.Items.Add("John " + RND(100))
 $SubItem = $Item.SubItems.Add(RND(100))
 $SubItem = $Item.SubItems.Add(RND(100000))
Next

;
; Start My App
;

$Form.Center
$Form.Show
If $ListView.FocusedItem
 $ListView.FocusedItem.Selected = 1
Endif

While $Form.Visible
 $= Execute($Form.DoEvents)
Loop

Exit 0
Back to top
View user's profile Send private message
MACE1
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 12 Oct 2004
Posts: 130
Location: Manchester UK

PostPosted: Sat Oct 13, 2007 12:55 pm    Post subject: Reply with quote

This looks to work VERY well. Very Happy

Have made use of it in the manner I required.

THANK YOU LOTS !!
________
Hashish


Last edited by MACE1 on Fri Feb 18, 2011 5:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Tue Mar 18, 2008 9:26 pm    Post subject: Reply with quote

Shawn wrote:
Check-out the lastest development build. Listview column sorting (by string) is now built-in to the control. One can turn it off with the AllowSorting property ... Next build will have sorting by different builtin "types" - ie, numeric, text, datetime.

Nice, nice Smile

yeah the types are necessary... if you've got numbering from 1-10+ and sort by numbers, you'll get 1,10,11 etc. Is that perhaps what you mean with "human" or "bubble" sort (yes yes... I'm too tired/stopid to read up on that :p).
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group