Filtering and Multicolumn Sorting in Syncfusion’s Grid Control

Last week I was working with a C# application that used Syncfusion’s standard grid control and I was trying to add filtering and multicolumn sorting to the grid. However, as it turns out, the grid does not support filtering or multicolumn sorting out of the box.

Instead, Syncfusion offers another control, called the GridGroupingControl that have these features. Unfortunately, this was very inconvenient for me as the application I worked on is well established and replacing the standard GridControl with the GridGroupingControl would require a tremendous amount of effort. I’ve been in touch with the folks at Syncfusion and finally reached the following workarounds.

Continue reading “Filtering and Multicolumn Sorting in Syncfusion’s Grid Control” »

Adding Formula Fields to a Database with Ruby on Rails

Every now and then you might encounter a situation where you need to have a database column that has a value based on a formula consisting of values of other columns. Unfortunately, there is no standard way of embedding this into the SQL definition of a table. You must keep track of updating this value on your own when using the database.

But, this begs the question, why would I want to have a formula field? Can’t I just do all my calculations when I am fetching my data with a SQL query? Sure, you can. However, if you are doing calculations on vast amounts of data, having part of this data pre-calculated in a formula field can give you a solid performance boost.

If you’re using Ruby on Rails for your project, there’s a very simple solution you can implement. I’ll show you how through a trivial example. In this example, we imagine a teacher wanting to store his students’ assignment marks.

Let’s go ahead and create our rails project called teacherexample. I’ll use MySQL as my database in this example, but the concept applies to any database system.

Continue reading “Adding Formula Fields to a Database with Ruby on Rails” »

Tossed Off My Bike

I was really thrilled yesterday after receiving my first paycheck. So, the first thing I did this morning was grab my bike and set off to the bank to deposit the check into my account. Everything went really smoothly (aside from the weather being a little sketchy). I was biking my way back home thinking to myself the infamous “I am rich, bitch!”. Then, in a split second, I find myself lying in the middle of the street, with my glasses lying three feet away from me. I have been thrown off my bike amid being hit by a car that was leaving the parking lot and entering the main road. A few seconds later I realized that my left leg is bruised and my shirt ripped in half (well, almost in half).

Ken, the car driver’s name as it turns out, was a really a nice guy. He quickly apologized and offered me a ride to the hospital. I checked myself out (not in the usual way people check themselves out in) and told him there is no need for that. To make a long story short, he gave me $100 as an apology and drove me back home, as my bike was completely busted.

Since I became bikeless, and Walmart was a fair distance away, my landlady was nice enough to offer me a ride to the store. There, I imagined I’d either have to pay to fix the bike or buy a new one. Luckily, they were able to fix it. Not only that, but I was able to exchange it for a much better bike and pay the difference (which was around $50).

So, honestly, having a “bike/car” accident worked out nicely. I was able to replace my cheap bike with a much better bike, make some cash, and make my Saturday interesting for myself. How better can it get?