SortedList duplicate Key values

They are displayed in the correct order. The problem is when something has gone wrong and two gadgets have the same position (same value), I get this error: System.ArgumentException: An entry with the same key already exists.

 

Maybe I can use the path as Key and the position as Value but then is it possible to make it sort by the Values instead?

What can I do to make sure it sorts them even though two gadgets have the same position and not cause an error? 

0
Saturday3AM
7/5/2008 3:50:46 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

2 Replies
517 Views

Similar Articles

[PageSpeed] 37

SortedList doesn't allow to sort by values. An workaround (but not using SorteList) is given in this thread: http://bytes.com/forum/thread230617.html


Mark replies as answers if they helped you solve the problem.
0
siva_sm
7/5/2008 5:30:20 PM
Thank you!
0
Saturday3AM
7/5/2008 6:58:23 PM
Reply:

Similar Artilces:

How to get a value from SortedList value
 Hi, the problem is as topic. I saved a sortedList with the value in which it contains multi-value. In my SoeredList "cart", the values are Quantity, UnitPrice, ProductName.Can anyone teach how I can get the values from the cart? Hi photossed, I notice that the status of the post is “Resolved”, is it marked yourself? If so, please post your answer in order that more others member learn from it.  Hong-Gang ChenMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Ways to get a mapping of values versus keys in a hash where there is one-to-one mapping between the keys and the values !
------=_Part_6250_27861417.1227632496175 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I recently had one requirement where I needed to get the key in a hash on the basis of supplied value. There is one additional information that there is one to one mapping between the keys and the values. I was able to do that by defining a extra array and hash variables as shown in the program below but I feel this approach will not work for all scenarios like :- 1. When the value of a particular key is undef in the ori...

Get value of primary key after INSERT statement using Web Matrix (VB.NET)
I am using the following function developed using Web Matrix to insert a record into a table when the user clicks the submit button.  How can i get the "primary key" or value of the inserted record back to the application.  The following is my insert statement:Sub btnSubmit_Click(sender As Object, e As EventArgs)      CreateMyRecord("98", "UU1")       '==> need the primary key of the inserted record here.......End SubFunction CreateMyRecord(ByVal streetNumber As Integer, ByVal authorityRef As String) As Integer&nbs...

gridview_deleting getting key values e.values
im having some trouble pullin in the values i need from the gridview DataKeys.. any helps thanks.. dataKey="ID, pdfUrl"Protected Sub GV_Deleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting 'the below pulls the index of the row set to deleteDim RowNo As Integer = Convert.ToInt32(e.RowIndex)'pulls data out of one of the fields' is there a way to specify ("ID") or ("pdfUrl")? and dont I need to tell it the index? Dim myID As String = e.Values.Item(1).ToString() End Sub &n...

Get all values from Mapping Table including duplicate value
Hi all, I define a local variable as a node set that gets value from Mapping Table. It always returns unique value. For example, local variable is supposed to return {"","","1","3","2","3"} when the destination equals "100". But it returns {"","1","3","2"} every time. How can I get all value from mapping including the duplicate value? Here is my rule: > <do-set-local-variable name="lvPosition" scope="policy"> > <arg-node-set&g...

how to implement key/value collection that accepts duplicate keys
basically i want a collection object that i can dynamically increase size of which will allow duplicate keys. any ideas if this is possible. DataTable  You can also insert your own custom objects to it. Though in such case the key field wouldn't be a primary key but basically it would be possible.Thanks,Teemu KeiskiFinland, EU Allowing duplicate keys violates the concept of a key/value collection.  Have you considered the NameValueCollection class that while not allowing duplicate keys does allow multiple values under the same key?  When you reference the Item pr...

Getting Start With .net
hi i'm intersted to learn asp.net (vb or delphi) . i programming with delphi6 but i'd like to tp know something about programming in internet specially with .net . i hear about microsoft.net with delphi 7 that i can programming with delphi in .net .... is it right ? what 's our opinian about it ? and better to learn Vb.Net or continu with delphi(or delphi.net) thanks. Ali Darabian I think there is some support for Delphi in .Net. However, you will find much more support from the user community if you choose a more popular language such as VB.Net or C#. Since your al...

how to get start with .NET
the net help people installed  to my desktop 1-microsoft visual studio .NET enterprise developer 2003 2-microsoft .NET framework 1.1 what else do i need ...???  and how can i try with some simple code in VS.Net and run it to see wat happen...????? please help If you want to develope web applications, then you'll also need IIS on your PC.  That'll require XP-Professional or Windows 2000/2003, but XP-Home edition won't allow IIS installation. As for how to get started, you can search the web for some tutorials or buy a good book on VS.  The topic is way too vast to...

Where to start and how did you get started?
Hi, I have had a feeling for a long time to jump into the adds market for some time due to my low income (shooting for the stars) and I don't have anything better to do these days. But I find it really difficult not to give up due to lack of guides (what I can find atleast) and all the hard words which only makes me confused. But I won't give up. Never. Not sure if this is the right place to post this, but I deffinitly would be really greatfull for help getting started. How did you get started? +If there are any teacher that wanna show me the ropes private, I can give payment with ...

problem with get value from textbox after get it value in load page
hi every one  i have problem with my web site when i get textbox value in load page   and Changed textbox the page do not take last value .   it take value in load page   this is code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)   TextBox1.Text = "aa" End SubProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) MsgBox(TextBox1.Text) End Sub   when i press button message write "aa" while i changed the textbox   please if enyone knowen help me &nbs...

SortedList with duplicate keys error
I am reading through some records that I am extracting from a database into a SortedList() but I am getting an error that says:Item has already been added. Key in dictionary: 'DEV' Key being added: 'DEV'  This is my code:  EnvList.Add(reader.Item("Env_Code"), reader.Item("Env_Code"))I think my problem is that there are duplicates within the SortedList and does not allow for another Key of the same to be added to my SortedList. I know I can set up a flag that checks to see if the key of that value has been added (SortedList.Contains...

How do I get started with AJAX.Net?
Hi All, I'm a seasoned asp.net developer but have not yet ventured into atlas et al.  I prefer books, but will take whatever I can get if it's good and will get me going. Any recommendations? Thx in advance. Jeff try here first http://ajax.asp.net/downloads/default.aspx?tabid=47 then learn from sample and docJames Wu (MIB426).NET is only way to goMCP, MCSE, MCDBA, MCSD, MCAD I find the materials online display features and implementations but are lacking architectural depth, and am seeking more comprehensive resources. By architectural depth, I mean that I cannot watch ...

Getting started .net website
Hi folks,Does anyone here know of a good website to just sit back and read for learning .net? Thanks in advance.Baldeep Right here... Click the Get Started and Learn sections here. Quite a few out there - - this one, has a lot of good videos -  also ASPNet101.com, but then, I might be a little prejudiced David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(P...

Starting value of primary key.
How do i set the starting value of the primary key in a Access database? I don´t want it to start with no.1, i want it to start at 10000 like it´s done in the nortwind database. please help me. ALTER TABLE myTable ALTER COLUMN myPrimaryKey COUNTER (10000,1) This will set the seed value to 10000 and the increment to 1. TerriTerri MortonEngagement Manager, NeudesicHow to ask a question...

Web resources about - SortedList duplicate Key values - asp.net.getting-started

Windows Environment Variables Manager Home
skip to main - skip to sidebar Windows Environment Variables Manager Environment Variables Manager (EnvMan) is an open source tool written in ...

Singularity RDK - Source Code
Experimental verified OS

Beware the Bloated Constructor
public ActiveProduct(Product product, StringVersion driver, Side es){ Side = es; try { if (product == null) throw new Exception("Can't create ...

Searching
Searching

consistent-hash - consistent hashing in C# - Google Project Hosting
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using Sys ...

CA1058: Types should not extend certain base types
Sign in MSDN subscriptions Get tools http://www.facebook.com/microsoftdeveloper https://twitter.com/msdev http://plus.google.com/111221966647232053570/ ...

QuiteCode.com The place C# Developers come for their coding needs
The place C# Developers come for their coding needs

Computational Knowledge and the Future of Pure Mathematics
Proposing technology for pure mathematics: curating concepts, constructs, theorems, & literature; precise symbolic language; automated computations... ...

scipy.sparse.lil_matrix — SciPy v0.13.0 Reference Guide
Scipy.org Docs SciPy v0.13.0 Reference Guide Sparse matrices ( scipy.sparse ) index modules next previous scipy.sparse.lil_matrix ¶ class scipy.sparse. ...

Quake Hidden Surface Removal
[Image] Quake Hidden Surface Removal [Image]This is the third of the references provided by Derek Nickel, anotherarticle published in the Dr. ...

Resources last updated: 12/30/2015 9:47:08 AM