The Reddest

The Reddest


  • Name: Brandon Cannaday
  • Favorite Languages: C#, Javascript, C++
  • Website: http://www.paranoidferret.com
  • Location: Lafayette, IN
  • About Me:
    Even though I'm a programmer, I enjoy spending a lot of time outdoors - hiking, camping, etc. I spend most of my programming time in high level languages and user interface design. Most of my tutorials on this blog are about WPF, C#, or Javascript.

Published Tutorials (120)

Recent Comments

  • WPF Tutorial - Using The ListView, Part 1
    02/02/2012 - 16:51

    The easiest solution is to switch to the DataGrid. Since that was released, creating GridViews isn't really an approach I do very often.

    If you have to use a ListView, I could see using a Multibinding and a converter to get that done. Basically setup a Multibinding to bind the width of the column you'd like to stretch to the width of the ListView and the widths of every other column. Then, whenever any of those change, the converter can set the width of the stretch column equal to the total width of the ListView minus the widths of each column. That should make it fill the remaining space.

  • WPF Tutorial - Using The ListView, Part 1
    02/02/2012 - 13:04

    It's not technically a column, it's just the extra space. This ListView doesn't have a direct means to make the columns fill the available space. The DataGrid does however. If you set the width of a DataGridColumn to "*", that column will expand to fill the remaining available space.

  • C# Snippet Tutorial - Custom Event Handlers
    02/02/2012 - 10:25

    The best reason to use events is to eliminate unneeded dependencies. If we were to use a direct method call, then the Car class would have a dependency on another object - the one that defines the method.

    If we wanted to use the Car class is several different projects and by several different consumers, the Car class doesn't need to know anything about them. All it has to do is fire an event - any object can then attach and be notified.

    Most objects in the .NET framework are implemented this way. The Button class has a Click event. This allows the Button class to be used in a million different projects by a million different developers.

  • XML Parsing with jQuery
    02/01/2012 - 09:58

    You could try:

    $(this).find('group')[1].find('size').text();

  • XML Parsing with jQuery
    01/25/2012 - 09:50

    I believe you're running into a security violation. The javascript is making a callback to a local resource (file://). Browsers don't typically like doing that because then any website can start reading files from a visitor's computer.

    To test your application, you may have to run it in an actual web server. If you're on Windows, you can install and setup IIS fairly easily on your local machine.

  • XML Parsing with jQuery
    01/24/2012 - 22:59

    Does the Javascript error console say anything?

  • auto shutdown application
    12/20/2011 - 10:43

    1. Use GetProcessByName to get a Process object for the each name the user entered in the textbox.

    2. For each Process object, set EnableRaisingEvents to true.

    3. Hook the Exited event on each Process object. When all of them have exited, shutdown the computer.

  • XML Parsing with jQuery
    12/08/2011 - 09:46

    If you enter the URL in the address bar, you are directly instructing the browser to request that resource - just like any other website. When javascript is doing it, the user visiting the site has no control over what is being requested. This is, more often than not, an annoying security restriction, but there are legitimate reasons why it exists.

    Here's a Wikipedia article on the same origin policy, but there are tons of other articles out there as well.

  • C# Tutorial - Binding a DataGridView to a Database
    12/08/2011 - 09:36

    Both types are in the System.Windows.Forms namespace. If you created a Windows Forms applications, you should already have the reference. If you're creating a WPF application, then you should use the WPF DataGrid. This tutorial does not apply to WPF applications.

  • XML Parsing with jQuery
    12/06/2011 - 11:38

    There are mechanisms that will allow cross-domain requests to be made. These are typically on the server-side. Yahoo allows cross domain requests to be made and Google does not.

    We've used Yahoo Pipes for a couple of tutorials here to act as a proxy to APIs that do not allow cross domain access.