|
-
Jul 12th, 2007, 09:02 AM
#1
Thread Starter
Hyperactive Member
[2005] ListView column sorting!
Can anyone provide me with an example of a ListView column sorting function?
-
Jul 12th, 2007, 09:22 AM
#2
Re: [2005] ListView column sorting!
-
Jul 12th, 2007, 09:25 AM
#3
Hyperactive Member
Re: [2005] ListView column sorting!
If my post helps , please feel free to rate it 
-
Jul 12th, 2007, 10:08 AM
#4
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Good codes, but I do not understand them with my current knowledge and experience in Visual Basic 2005. I would like one of you to create a simple function or sub that can do it.
-
Jul 12th, 2007, 10:13 AM
#5
Re: [2005] ListView column sorting!
Not a chance, mate—if you don't understand the second article linked there, keep reading and practising until you do!
If you get stuck with anything specific, then we'll be glad to help with that.
-
Jul 12th, 2007, 10:15 AM
#6
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Awww come on. I know it's possible to make a simplier code. What I don't want is a whole class that does this. I want it to be 1 single function or sub, no matter how advanced it is. That's all I ask for.
-
Jul 12th, 2007, 10:20 AM
#7
Re: [2005] ListView column sorting!
Sorry, but that's just not how sorting is done.
It's a frequently held presumption that classes have to be huge, unwieldy, behemoth-like things. In actual fact, I've written a few classes that actually contain no code at all, and exist purely for semantic reasons. All they are is a language facility just like control structures and methods.
It's often simpler to implement algorithms as combinations of methods, and involving one or two helper classes, than it is to try and pack it all into a method—in fact, in some cases it is unfeasible and even impossible to implement a particular algorithm using only one method.
Have a go. See whether you can make sense of it. If you can't, then we can try and explain how it works.
-
Jul 12th, 2007, 10:21 AM
#8
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Well, maybe provide me with a better example then? Also, don't link to other sites. I don't like that. Please, I am begging you to provide and example here instead.
-
Jul 12th, 2007, 10:24 AM
#9
Re: [2005] ListView column sorting!
The second article looks fine.
Disregard the first link (sorry Hack): it's for VB6.
-
Jul 12th, 2007, 10:25 AM
#10
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Well, I know, but I just don't know how to use it
-
Jul 12th, 2007, 10:30 AM
#11
Re: [2005] ListView column sorting!
 Originally Posted by Mathiaslylo
Also, don't link to other sites. I don't like that.
This isn't your forum. We often link to other sites because they provide good code examples. If you don't like links, ignore them. But if you haven't noticed, nobody here is going to write the code for you. We give guidance, not answers. I'm pretty sure nobody here with serious development jobs got them by coming online and saying "I need code for a business app, can someone write it for me?" No. We have our jobs because we learn things. We take a basic understanding or foundation of a task, figure out how it works, then apply it to our specific needs. Although I will say, depending on what the source of the data is to be sorted, it could be incredibly easy to do... in other words, one simple line of code that's built in. All you have to do is look.
-
Jul 12th, 2007, 10:32 AM
#12
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Listen up pal. That post there didn't quite help me very much! And I know that people out there like Atheist has been providing me with very genuine fine examples multiple times from his own mind! Mind your own business, or at least make a topic that'll help. Don't just make useless posts like that to increase your post amount. You just wasted further 5 minutes of my life.
-
Jul 12th, 2007, 10:35 AM
#13
Re: [2005] ListView column sorting!
Take it easy mate—we're all just volunteers here. 
Did you get the gist of how the comparison class works? If not, then we can work on that.
-
Jul 12th, 2007, 10:36 AM
#14
Re: [2005] ListView column sorting!
Try seeing the forest for the trees sometime. You might find that there were a couple of nice little implications in my post.. and if you had bothered to find them, you also might have noticed that they ask for specific things... not a broad topic. Broad is hard to deal with.. specific is much easier. "How do I write a calculator?" or "How do I track which operand is in use for a calculator?" is an example. The former is far too broad to answer.. but the latter will quickly create several pinpoint suggestions.. not answers, suggestions, to help the person get in the right direction. Learn a little bit. It just might do you good.
-
Jul 12th, 2007, 10:37 AM
#15
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Well before you came and ruined it all, I was trying to learn something.
Does "Well, I know, but I just don't know how to use it " ring any bells?
-
Jul 12th, 2007, 10:40 AM
#16
Re: [2005] ListView column sorting!
Yes. And it's too broad. Be more specific in your questions. Look down the thread list... notice the broad ones tend to have fewer replies than specific ones, and if it doesn't, it's been narrowed down in the thread. "I don't know how to use the String class" is a wonderful place to start.. but hard to help with. And if you know, what's stopping you from playing around and figuring it out? That's the best way to learn something. I hate books, I hate lectures, because I don't learn from them. Give me a computer and a task, and I'll figure it out. Most people learn best by doing. So do. And learn.
-
Jul 12th, 2007, 10:42 AM
#17
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Well, a deadline in 8 hours is stopping me from playing around with it and figuring it out, alright?
That reply was for the first link. I don't know how to use it to sort columns.
-
Jul 12th, 2007, 10:45 AM
#18
Re: [2005] ListView column sorting!
The first link was VB6, as was previously mentioned. Look at the second link instead. It looked like it had better code, and was built for .NET.
-
Jul 12th, 2007, 10:45 AM
#19
Thread Starter
Hyperactive Member
Re: [2005] ListView column sorting!
Well, I don't understand that one either. How do I use it?
-
Jul 12th, 2007, 10:48 AM
#20
Re: [2005] ListView column sorting!
The top part is the custom class... start by creating that. The lower half is the event handler for the ListView. Add that in, modify code accordingly, go from there.
-
Sep 27th, 2007, 09:42 AM
#21
Lively Member
Re: [2005] ListView column sorting!
Just looking into doing this myself and found this thread using search.
I'm stunned that .net makes such a mission from sorting subitems!
in vb6 you simply changed the SortKey. Job Done. Any idea/theory as to why .net has taken such a backward step ????
Background: I have many years VB, Access and SQL experience, and will offer help wherever I can.
I'm on here because I'm learning vb.net, and appreciate any and all help getting me up to speed.
cheers
Ray 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|