Another story in what it’s really like to develop software. These are the kinds of hacky bodges you will end up making in any system that is more than a few months old and is in production.
These hacks do not make me happy. Especially when they are hacked because of pre-built components that are meant to save you time!
The Telerik Radgrid is both a blessing and a curse at the same time. How can a grid, that seems designed to have a dropdown column in it and comes with default filtering, not take into account the fact that you are going to have foreign keys in a grid that you want to filter on?
This is an ongoing rant of mine. Getting good foreign key support on large enterprise applications seems like an uphill struggle every single time. I wrote about how I like to see books on programming jump right in and show me how to get my foreign key drop downs hooked up almost right off the bat, since it is almost entirely unavoidable in any application that has any sort of usefulness in my opinion.
My goodness getting the RadGrid to do your bidding can be an infuriating ride. Personally, I think components should just work out of the box. I know the RadGrid is extremely complex and there are layers upon layers of documentation and examples on the Telerik site, but to me, I shouldn’t have to find out about how difficult it is to filter on ListTextField after I’ve knocked up a prototyped to a client. Heck the documentation should have a large caveat at the top telling you the limitation of the software. Really, I shouldn’t need to read that far into the documentation just to use the component in my opinion. I want something quick and easy to take the pain out of grid based data admin, not a whole new bloody thing that I have to learn inside out.
As per Telerik’s website:
he built-in GridDropDownColumn will be filtered by its ListValueField when the default filtering feature of the control is used. Filtering by ListTextField is not attainable in the present version of Telerik RadGrid
Great. Thanks! This is burried in the How To section. Okay, not too obtuse, but still, all the basic examples show filtering on example datasets that are things like Customer listings (with Customer, Contact Name, Company). Heck, it is reasonable to assume that Company was being looked up using the GridDropDownColumn column. Isn’t it?
So, Telerik provide a solution – have a hidden field that is the text description. Capture the ItemCommand on the grid and then if it is a filter command, pop the filter text into the hidden field’s filter text box and run the filter based on that criteria. The problem is, out of the box this breaks user experience because the filter text they typed in disappears.
Now you have to hack around to find a way to keep the filter text there. Come on Telerik, get this one together. Not pleasant. I gave up, because I didn’t have time to delve that deeply into the RadGrid. I needed something quicker. Option 2 given by Telerik – implement a custom drop down in the actual filter area of the grid. The example code was long and I didn’t feel like going through it – again time constraints. I just couldn’t spend time exploring all of this because I have deadlines. Why couldn’t they just build this into the grid? If they have solutions, it shouldn’t be that difficult to put it into the base functionality.
One more thing – putting a drop down in that is based on an id field (and let’s be honest it probably is if it’s a lookup into another table) means you get the default “number” filtering options. This means that the filtering options out of the box are things like “greater than”, “less than” etc etc. These don’t make sense for a user who is filtering based on text. This is another fault with their default solution outlined above of using the hidden field and substituting values in. I know you can overide this and put your own filtering menu in, but say it with me…..deadlines.
By now, I’m not a happy bunny. What did I do in the end? I amended my stored proc to bring back a complete result set with description fields (making things slower for me because now I have table joins). Then I hid the drop down list field until the user wanted to edit the row or add a new row in. Then I hid the description fields and showed the drop down fields.
What a bodge.
Here’s a lovely little one that just took me much to long, probably because I’m tired, or having an off day or something:
SELECT [Name] [Surname], [Address], [Telephone], [Email] FROM ATableAboutPeople
See, the error isn’t obvious, because the SQL compiles and runs, but the result set just doesn’t bring back what you expect…..because [Name] is now aliased as [Surname] – all because of a missing comma.
Bollocks!
Hate it when that happens.

There are days when ASP really lives up to its namesake and just completely kills you, or more accurately, kills your webserver that has previously managed to woo you as if it were Cleopatra herself.
Seriously. Microsoft needs to sort out this inter platform CLR bollocks. How is it that an application working perfectly on a local machine and a test server fails on a production server? Versions? Bollocks – all the asp.net versions are the same. I bet even they wouldn’t be able to answer it. Then to add insult to injury, all they give you is
Void System.Web.UI.WebControls.Parameter..ctor
Yah. Okaaaay……very helpful there Mr M$ ASP.Net. I mean, sure. That makes a lot of sense. I know exactly what to do now.
Thank goodness for the interwebs, otherwise I would be stuck trying to decode this nonesense myself. To the rescue this blog post. Thank you good sir.

If you jump between Linux and Windows XP like I do, sometimes you’ll pull your Rails app into the dreaded M$ platform, fire it up and be greeted with a lovely “Internal Server Error”. Naturally it goes on to say something like “You have a nil object when you didn’t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each” despite the fact that you’ve changed no code since last night when your app was running rather nicely in a Linux environment thank you very much. Sometimes you just need to hack your way out of a problem without worrying about the whys and wherefores – and that’s exactly what we are going to do here. So……open up config\environments\development.rb and find this line :
config.logger = Logger.new(config.log_path, 2, 10.kilobytes)
comment it out comme ça
#config.logger = Logger.new(config.log_path, 2, 10.kilobytes)and fire it up again. All good? Yes? Excellent. Fixed. Why? Um. Log rotation in XP apparently. Something funny about it. Don’t really know. Haven’t investigated it much further because there is no way in hell I’m going to run a production Rails app in Windows. Ever.
Yes indeed folks, I bring you the number of passports lost or stolen in Europe as recorded by the British consulates in said countries for the year 01 April 2008 to 31 March 2009.
Red = worse. From which we can falsely infer that we shouldn’t go to the red ones because you are more likely to have your passport stolen

One of the blessings in WordPress is the vast array of plugins available. However, it is also one of the curses….because it makes us lazy. While this doesn’t seem to be problematic in the short term, in the longer term, large numbers of plugins can cause blogs to slow down, and even worse, the various plugins could start interfering with each other. So, whenever I can, I like to write my own code – the two advantages are that
1 – I can control exactly what goes in to the code, making it do what I need and no more
and
2 – I’ve written the code so if things start to clash, it’s going to be easier to debug.
So, let’s learn how to create a WordPress page to display every comment on our blog and just for fun, let’s also code up a quicktag which we can place into any page or post where we want the comments displayed.
(more…)
private Dictionary theThingThatWasNotUnique(){ blah blah blah; Dictionary aSetOfResults= new Dictionary(); foreach (DataRow dr in ds.Tables[0].Rows){ DateTime startDate= (DateTime)dr["dtStart"]; string activityName = (string)dr["sActivityName"]; aSetOfResults.Add(startDate, activityName); } }
Okay, the Dictionary object in C# is pretty neat. I mean it’s fast and light because it’s essentially a hash table and it really is nice to enumerate through. The gotcha is, it relies on unique values in the key. And herein lies the problem with the code above. In the application I was troubleshooting, the dates that were stored were not guaranteed to be unique. This is really a simple case of not understanding the data structure properly and making false assumptions. (more…)
Here’s a one column minimalist wordpress theme for you, based on my current blog’s look and feel. The theme is text based and probably best suited to people who want to actually write a blog rather than set up a bunch of advertising in their sidebars which seems to be the norm today. I’ve bucked the trend of having overly busy home pages and magazine style layouts. I mean really, you are not a magazine, and if you were, you would probably not be using a free theme
. Widgets are displayed at the bottom in a three column footer.
True to tunaslut ideals, this theme is certified dolphin friendly.
Download In Brine WordPress Theme now hosted at wordpress.org
Stamus Contra Malum. Latin speaking intellectual snob. But there you. He makes some sense, sometimes.
So, I decided, for better or worse, to play around with Expression Engine a little bit. I don’t know why. Maybe I got bored with WordPress. Maybe I just wanted to try something different. Maybe I’m experimenting. Who knows. Anyway, I go about installing EE, which is obviously not as easy to do as WordPress….by which I mean, you need to set up your database yourself and do all the uploading through ftp etc etc…..call me spoiled, but with WordPress being such a de-facto standard, my webhost has a one click install for it which does everything for me. Not that I’m complaining, it was far from difficult to do, though probably not the sort of thing your nan would be comfortable with. You know, setting up a new mysql database and user and all of that is not something the average non-techy person should need to do in this day and age. Of course that sucks if you just want a blog on your webspace and you don’t feel like paying someone to install it for you, but you know, thems the breaks (you could always hire me to get you up and running – I’m not cheap, but I am good
….eh who am I kidding, I’m cheap like a two dollar tunaslut, but I’m so good you’ll keep coming back for more ). (more…)
Older Posts »