October 2009

You are browsing the site archives for October 2009.

Today I ran into this problem for the second (and hopefully last) time. Let’s take a look at the words “sorted” and “list”. “sorted” suggests that the items of the list will somehow be sorted. So far, so good. “list” would suggest that you can put any item in the list. Specifically, it isn’t called “SortedSet”, so you could expect that you in fact can add the same item twice with the same key.

Well… that’s where you’d be wrong. The documentation says that the sorted list throws an ArgumentException if “An element with the same key already exists in the SortedList”. Unfortunately I don’t go around looking through the documentation to search for stuff like that. And in fact: you shouldn’t have to. A list is a list and not a set. And if you decide to implement a sorted list with a dictionary as the backing store, then you are – quite frankly – an idiot.

If you would like to save yourself a lot of grief, just don’t use the sorted list. Use a regular List and the Sort method. But be aware, that the Sort method uses the quicksort algorithm which is unstable (elements that are “equal” don’t keep their relative positions to one another).

On Friday I tried to update one of the legacy DataSets of the application I’m working on. When I double-clicked the data set schema, VS just opened the XML view to edit the schema. Quite useless. So I right-clicked the item and selected “View Designer” which then brought up a new window that contained all the inner text of the XML document as one large blob. More than just useless…
Today I started looking for a solution or possible cause for the problem. It would seem that the data set designer was not loaded on VS startup. The solution then was quite simple: Open a command line and start

devenv /resetskippkgs

This tells VS to reset its list of skipped packages and load everything. Now I can use the designer again.

When using a AutoCompleteExtender from the AjaxToolkit, Firefox may show it’s own AutoComplete List over the one you want. To disable that, you need to disable autocomplete on the Field or the entire Form.

To do that, just add an autocomplete="off" to the Textbox in the Markup Code or add the Attribute on Runtime like this:

Textbox1.Attributes.Add("autocomplete", "off");

Today, I tried to add the AjaxControlToolkit Controls to my Toolbox in Visual Studio 2008. But when I selected “Choose Items…” in the Toolbox, Visual Studio just crashed without any Errors.

That could happen because of some defect or deinstalled Toolbox Items.

Here’s how to fix that:

  1. Search the Binary devenv.exe
  2. Start it with the command line Parameter /safemode
  3. Use Choosse Items... in the Toolbox
  4. Click thru all the Tabs
  5. Close Visual Studio
  6. Open Visual Studio normally and it should work again