472,807 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,807 software developers and data experts.

Generic SortedList question

This is where a different thread ended.
The subject of this query is quite different from that of the other thread
so I thought I should start a new thread.

I'm using
Private mItemList As SortedList(Of String, StringWithInteger)

To populate a generic CombBox

StringWithInteger has two properties Str and Value

I need to get the Value property of the StringWithInteger part of the
selected item

The selected item should have the same type as the SortedList items (I
guess)

I got this far
= DirectCast(ComboBox1.SelectedItem, SortedList(Of String,
StringWithInteger)).Value
I don't think I want to cast to SortedList but something like
SortedList.Item

I noted the term KeyValuePair(of String, StringWithInteger)
but don't know how to use it

Thanks for any help
Feb 20 '07 #1
2 1284
I posted an answer in the previous thread.

Robin S.
-----------------------
" active" <ac**********@a-znet.comwrote in message
news:uQ**************@TK2MSFTNGP06.phx.gbl...
This is where a different thread ended.
The subject of this query is quite different from that of the other
thread so I thought I should start a new thread.

I'm using
Private mItemList As SortedList(Of String, StringWithInteger)

To populate a generic CombBox

StringWithInteger has two properties Str and Value

I need to get the Value property of the StringWithInteger part of the
selected item

The selected item should have the same type as the SortedList items (I
guess)

I got this far
= DirectCast(ComboBox1.SelectedItem, SortedList(Of String,
StringWithInteger)).Value
I don't think I want to cast to SortedList but something like
SortedList.Item

I noted the term KeyValuePair(of String, StringWithInteger)
but don't know how to use it

Thanks for any help


Feb 20 '07 #2
I figured this was really a different subject
Thanks
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:gb******************************@comcast.com. ..
>I posted an answer in the previous thread.

Robin S.
-----------------------
" active" <ac**********@a-znet.comwrote in message
news:uQ**************@TK2MSFTNGP06.phx.gbl...
>This is where a different thread ended.
The subject of this query is quite different from that of the other
thread so I thought I should start a new thread.

I'm using
Private mItemList As SortedList(Of String, StringWithInteger)

To populate a generic CombBox

StringWithInteger has two properties Str and Value

I need to get the Value property of the StringWithInteger part of the
selected item

The selected item should have the same type as the SortedList items (I
guess)

I got this far
= DirectCast(ComboBox1.SelectedItem, SortedList(Of String,
StringWithInteger)).Value
I don't think I want to cast to SortedList but something like
SortedList.Item

I noted the term KeyValuePair(of String, StringWithInteger)
but don't know how to use it

Thanks for any help



Feb 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: orekinbck | last post by:
Hi There I am probably missing something fundamental here, but I cannot see a method to search the values of a generic dictionary so that I can find the key ? Of course I could enumerate...
2
by: newscorrespondent | last post by:
I have a list declared: public System.Collections.Generic.SortedList<int, System.Collections.Generic.List<MTGTracer ActiveList = new SortedList<int,List<MTGTracer>>(); The key is an integer...
2
by: Prez | last post by:
I started writing .net code yesterday and I am grasping it well enough. I have a few questions about SortedLists. I am using managed C++ if that makes any difference. Of the examples I...
2
by: Bruce Arnold | last post by:
I have a program that works fine using Remove and Add to update a value. The program processes a log file from a router and counts the hits based on url. It bothers me to use Remove/Add when all...
4
by: Oscar Thornell | last post by:
Hi, Any comments regarding this implementation... SortedList<String, Stringlist = new SortedList<String, String>(); lock (((IList)list).SyncRoot) { foreach (Object item in list) {
4
by: semedao | last post by:
Hi, I want to implement list of key-values that can be sort by 2 ways. let's say that in the first step I wanted to make SortList based on Key = int index that cannot change and Value is another...
1
by: raylopez99 | last post by:
I seem to get name collision between the Generic collection SortedList and C++.NET Framework collection SortedList. How to resolve? Here are the libraries that seem to clash:...
1
by: Ethan Strauss | last post by:
Hi, I have been using a variety of generic collections and I really like them, but I have just noticed something weird ... If you have a generic Dictionary (or SortedList), you can retrieve...
1
by: Harold Howe | last post by:
Howdy all, The msdn help says this about SorteList<k,v>: "If the list is populated all at once from sorted data, SortedList is faster than SortedDictionary." My question is this: how do I...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.