Multiple Sorts On List<Of T>?

Apr 1, 2011

I am using VB.NET and .NET framework 3.0I am currently sorting a list like this: lstPeople.Sort(Function(p1, p2) p1.LName.CompareTo(p2.LName))However, now I want to sort by FName as well after the LName. So it sorts first by last name and then by first name.

View 3 Replies


ADVERTISEMENT

List(of T) Custom Sorts In VB

Oct 13, 2011

Im converting a winforms application and it has gone smoothly except for trying to get custom sorts for generic lists working.

VS 2010 ASP.net 4.0

I have my classes in App_code but it fails to work like the winforms version.

Dim ReturnList as List(of Quotedata)
ReturnList.Sort(New SortQuoteDateAscending)
> Unable to cast object of type 'SortQuoteDateAscending' to type 'System.Collections.Generic.IComparer`1[Quotedata]

Is there a gotcha with asp.net implemenation of custom sorts in asp.net 4.0 or am I missing something.

Public Class Quotedata
Private m_quotedate As Date
Public Property QuoteDate() As Date

[Code]....

View 3 Replies

Create A List Of List In That Would Like To Work On Multiple Accounts At Same Time

Oct 24, 2011

i am trying to create a list of list in that i would like to work on multiple accounts at the same time. lets say i have 5 accounts. every account has a seperate name. each account has a few fields. so i though of having a list of bookkeeping (with 5 accounts) and a list of accounts (with expense, income, tax, status, etc as fields). [code] and if the idea of using list of list works how do i loop through both lists.

View 6 Replies

.net - IComparable - Call Different Sorts?

Aug 17, 2010

I have a DTO that I am using to process transactions. To ensure that it is processing in the correct order, I am using iComparable and sorting the List(of T) of the DTO. That works great. However I just got another requirement that the customer wants the output in a different order... is there a way to allow me to have two different sorts for the same object, or do I need to copy the current class, save the output as a new List of that type and sort using the new way for that object?

View 2 Replies

Multiple Textboxes To Multiple List Boxes?

Mar 13, 2012

Okay this is the simple thing I'm trying to accomplish. I can get richtextbox1 to add to listbox 1. but i cant get both to add. the compare works fine. I'm stumped.

View 3 Replies

Dataset Merging Sorts Records Incorrectly?

Feb 4, 2011

I have a temp dataset (ds) that I load with data from a filtered dataset. I run this in a loop essentially populating the temp dataset with select records from the main dataset. I then merge the temp dataset back to the main dataset (dsSpecifics). The issue I am running into is that the records are loaded into the temp dataset in the way they were merged. record 1 is at row 0, record 2 is at row 1 and so on. When I merge the ds back to dsSpecifics, they load out of order but in a predictable way. Here is a snipit of the code:

myAircraft.Reset()
While myAircraft.MoveNext()
Me.TblAircraftSpecificTableAdapter.FillBy(Me.DsSpecifics.tblAircraftSpecific, CInt(myAircraft.Key.ToString))

[Code].....

It seems that after the final merge, the merge starts with the last record of ds and and then rolls over to record position 0.

View 1 Replies

Develop An Application Which Sorts Text Files?

Nov 6, 2009

I need a little guidance here. What I am needing to do is develop an application which sorts text files, approximately 10 at a time.It would look something like this. (Using VBA 2008)The code I am having trouble with, is I want to be able to "load" 10 of these txt reports.I want the Sort button to trigger the application to run through each text file looking for specific keywords.

And finally, when all is said and done, I want it to export a new text file with the keywords listed that it found.I am just breaking into this and am super excited with how much I have learned so far!

View 2 Replies

Develop A Converter Of Sorts - Math.ceiling Is Not Working?

Apr 26, 2012

I'm trying to develop a converter of sorts, and I need it to always round up, however, math.ceiling is not working like I would like. The converter I'm trying to develop is a Canadian MMAR Calculator.Here is my code.

Public Class Form1
Private Property growtype As Object
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click[cod

For some reason, when the variable < .5 it rounds down, and when the variable is > .5 it rounds up, I thought math.ceiling always rounded to the highest nearest whole.The issue comes at growtype 2 and 3, this equation "(num1 * 365) / (250 * 1) * 1.3" where num1 = 18 returns 34.164, I want this to round up to 35.

View 3 Replies

Build An Application That Will Serve As A Very Large Checklist Of Sorts?

Apr 21, 2009

I am trying to build an application using vb.net that will serve as a very large checklist of sorts. and i'm not exactly sure of the best way to do this. I considered using a database but i would need it to be self contained without having to rely on a server or internet connection

View 4 Replies

Retain Row Attributes In A DataGridView When User Sorts By A Column?

Oct 20, 2010

I have a DataGridView, bound to a dataset. All the columns are sortable (.ColumnSortMode.Automatic). The user may change data in certain columns, although not the first ("key") column. When data gets changed on a row, I change the backcolor for that row (to show it as dirty). At some point, the user will do something with all of these changes.

My problem is that I still want the user to be able to resort the data by any of those columns. When it's sorted, though, I lose the backcolors that I changed. I do know which rows are dirty, this is just a cosmetic issue. Isn't there a way to retain those backcolors, or any other such row attribute?

View 6 Replies

Created A Database Which Only Have One Table Where It Stores All Sorts Of Keywords According To Categories

Aug 9, 2011

I'm using MySQL 5.5 database. I have created a database which only have one table where it stores all sorts of keywords according to categories.

The users key in sentences in the textbox and then I'm suppose to classify the sentences into the category based on the keywords in the database.

How do I loop through the database to compare the strings in the textbox to the keywords in the db?

View 2 Replies

VS 2010 - Array SubString (of Sorts) / Making A Class That Represents A File?

Feb 24, 2011

Im making a class that represents a file. Im making a sub that reads data from one byte array into many properties. Now i need something that returns a byte array but only the first 4. Let me demonstrate because i can't think of a logical way of explaining. "something".substring(0,3) That would return a string containing "som" i need a function like that for a byte array


[code]...

Is there an existing function for this type of thing ? i've looked but didn't see anything that I understood.

View 2 Replies

Create A Console Application That Lets A User Enter 20 Names And Then It Sorts Them Out Alphabetically In Order?

Mar 25, 2012

I need to create a console application that lets a user enter 20 names and then it sorts them out alphabetically in order and then displays them.

Module Module1
Sub Main()
Const names As Integer = 20
Dim index As Integer

[code]....

View 2 Replies

TCP Client/Server App That Sorts Out Text That Is Recieved From Server?

Aug 18, 2011

I'm currently "trying" to make an app that gets a certain text from the client and sends it to a server and the server sorts it out every text that he gets from the client into a different label every time he gets a text from a client. For example :

Client1 sends certain text to Server and server puts it in label1.text
Client2 Sends different text to Server and server puts it in label2.text
Client3 sends different text than 1 and 2 to Server and server puts it in label3.text
and so on.

View 3 Replies

Add Multiple Items To A Dynamic List?

Apr 19, 2010

How would I add multiple items to a dynamic list without having to use the .Add method for each one?[code]...

View 10 Replies

Array List And Multiple Listboxes?

May 27, 2012

I am pretty sure that I understand what needs to be done here but I'm not 100% sure on how to go about this.I have a list box that contains a list of url's for websites. 100 to be exact.I have a web request defined in a private sub.What I need to do is to loop through the listbox1, grab one url, place it into the variable of the request and then save that entire web request (with link) to string.In the end I will have all 100 url's put into their own web requests and feed back into an array which I can then put into some sort of multi-threading method.

View 4 Replies

How To Create Multiple List (of String)

May 13, 2010

VB 2010 express. I have a situation where I want to create multiple list(of string), in a sub routine during run-time, where the list is available to other subs and functions in the same module, either to populate, edit or delete. The quantity of lists, names of the lists and their capacity will not be known until run-time. What would be the method and syntax for doing this?

View 3 Replies

How To Filter List Of(t) By Multiple Criteria

May 14, 2012

I am trying to filter a list of (t) by multiple criteria. here is what i have:

[Code]....

I now want to filter this list by myObject's various properties. Heres the problem:

1. A user should be able to either filter on one specific custName or remove the filter for this property AND

2. A user should be able to either filter on one specific notificationDate or remove the filter for this propertyl AND

3. A user should be able to either filter on one specific materialType or remove the filter for this property

I know I can just write a lot of if..then but i'm looking for a more elegant solution.

View 1 Replies

How To Find Like Integers In Multiple List

May 27, 2010

In a vb.net application I have a set of integers currently stored in multiple Arraylist (But this could be something different if required)

al1 = {1, 2, 3, 6, 7, 9}
al2 = {2, 3, 4, 9}
al3 = {2, 3, 19}

[code]....

View 3 Replies

How To Have One Scroll Bar For Multiple List Boxes

Jul 30, 2009

I have five list boxes showing a field from a row in a dataset in each of the list boxes.When the list gets beyond the size of the list box a scroll bar is auto generated However, I would like to have just one scroll bar for the five boxes be shown if possible so when I scroll with that, all of them scroll

View 7 Replies

How To Sort Multiple Column Of A List

Apr 15, 2009

I have a class for example:

Public Class Employee
Private mName As String
Private mSalary As Double

[Code].....

View 6 Replies

Removing Multiple Items From A List Box At Once?

May 2, 2010

If I have 3 times selected and when I click "submit" for example I want all my selected items to be removed, but when I try to do this only my first selected item is removed.

ListBox.Items.Remove(ListBox.SelectedItems)

How do I remove all 3 items from the list box at the same time?

View 2 Replies

Removing Multiple Selection From List Box?

Mar 19, 2009

How can I remove multiple Item selection from list box ?

Private Sub rf_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rf.Click
If Not (pb.Image Is Nothing) Then

[code].....

View 1 Replies

Storing Multiple Arrays Into A List

May 11, 2011

The scenario is:

1)A large 2 dimensional array (400,20)

2)The program needs to access particular chunks(for example (0,20) to (50,20)

3)The program will open multiple files and process each into it's own 2D array (400,20)

What I have right now is code capable of creating the array, but no way to store the array so that I can open a new file and process that data into another large array. Someone mentioned the generics List(of T) might be a good way to store each new array as you could use the Add function. I have done some research on the List(of T) class but I'm not totally convinced that is the way to go. I'm just looking for some direction as I've just started on .net this year.

View 7 Replies

VS 2010 Multiple Features To Add To List Box?

Aug 19, 2010

I have a ListBox which I add to from multiple other ListBoxes;Private Sub Add1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add1.Click lstOrder.Items.Add(lstTraditional.SelectedItem)End Sub But I have 2 ComboBoxes and a CheckBox which I would together like to add to the List Box as a single string.In context, I want to custom make a pizza order by:

Type of Crust (ComboBox)
Type of Sauce (ComboBox)
Toppings (CheckBox)

And you click a button which sends these details to the List Box.

View 12 Replies

Display Multiple Lines Of Data In A List Box?

Apr 1, 2012

I'm new to Visual basic (which will be obvious from my question) and am writing program that does various calculations, then displays the results in a list box. the results, however, are all concatenated, end don't each appear on a new line. I tried adding a carriage return/line feed at the end buit the compiler rejected it.

I can't find any examples of creating a list box, and adding multiple entries (one for each time a loop is performed), nor of how to use columns to make the resulting display cosmetically pleasing.

View 11 Replies

Display Only One Item In A List Box If Multiple With The Same Name Exist?

Oct 25, 2010

I have a listbox populated from a column in a table. The data in the column contains some of the same data for etc. The word watch would be there 10 times but I only need it to show once.

View 5 Replies

Get A List (or More Generically, Just An Object) Available Multiple Places?

Aug 23, 2011

In a program that I'm responsible for, we want to start keeping track of milestones. These milestones are quite simple and consist of a unique identifier, the project they're assigned to, a description, and a date that they should be accomplished by (or not, if there's no concrete due date).We use a slightly modified Model-View-Presenter architecture, and currently I'm passing this list around through the presenters, but it seems fairly clunky, so I was wondering:What's the best way to make this list available to all the presenters/views that need it?We're using VB.NET 3.5, and I was toying with the idea of making this a shared property of the main presenter, but it does seem like that adds some unnecessary coupling.

View 1 Replies

Multiple Forms - Using Data In List From Another Class

Jan 13, 2010

I am trying to develop a vb program where i am using List to store data. I want to use all datas saved in that list from another class. In Class 1, i am trying to include a method that will return my list. And form class 2, i will call that method and get that list. But code isn't working. [Code]

View 2 Replies

Multiple Textboxes Bound To Different Items In List?

Oct 1, 2010

On my form I have 3 textboxes. They get their data from a database query. The trick is the database may return 1 result or up to 3. If the query returns only 1 result, I want the first textbox populated, 2 results, 1st and 2nd textbox populated, etc... I also want to be able to track CurrentItemChanged Event for updating purposes. My initial thought was to use a list object as the binding source but how would I cycle through the list if it returns more than one so that I can assign the values to the 2nd and 3rd textboxes or if data is entered in to a blank textbox I want the currentitemchanged

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved