Kendo UI Grid - Sum a Column on Load

While working on a recent project I came across a need to sum a specific column of the Kendo UI Grid in my application after it loaded.   Specifically, I had a grid where one column of each row was the “Percent of Total”.  What the client requested, was that a message be displayed at the top of the screen whenever the sum of that column in all the rows of the grid did not equal 100%.

 

My first thought, was that I would handle this server side.  I could calculate the sum before I ever sent the data to the view.  Drop that sum in ViewData and I would be off to the races.

 

The problem with this approach is that in this project I was utilizing the excellent inline edit capabilities of the Kendo UI Grid.  This meant that the user could add a new row without the screen refreshing.  Without that server round trip, I could not be sure what I was showing the user was correct.  I needed something client side!

Read More

TrumpTexting.com

Recently I was chatting with some developer friends and we happened across an idea for a fun little web app that we instantly knew would have to be written.  We were discussing how crazy the current US Presidential election cycle seems to be this year and we were lamenting the seemingly outlandish things one specific candidate was getting away with saying.

The idea was to build a web/mobile application that would allow you to send your friends/enemies anonymous text messages containing a sampling of the crazy quotes Donald Trump has uttered in this election cycle.  

Politics aside, I instantly knew this would be a cool project to get up and running quickly and would allow me to explore some cool technologies.  I had some criteria that I wanted to meet before I set out to create the app.

  1. I wanted it coded/tested/deployed in under 6 hours
  2. I wanted to spend less than $100
  3. I wanted it to be awesome
  4. I wanted every quote to be legitimate.  Each quote must be cited.
  5. I wanted it to be completely anonymous. The receiver can not be aware of the sender.
  6. I wanted the receiver to be aware of when the other party received each message.
  7. I wanted the sender to be aware of any responses from the receiver.

The app is now up and running and you can check it out at: https://www.trumptexting.com

I think I came pretty close!  For criteria 1, I went slightly over my 6 hour constraint ending up at 7 hours, but I can live with that.

Getting a usable site up and running, even an admittedly small one, is an accomplishment.  This couldn't have been done in such a short time frame had it not been for building on platforms and services that are readily available.  Building on the shoulders of giants.  

I plan to write a series of posts outlining the details of how TrumpTexting.com was built.  However, to get things started here are the technologies used.

The number of libraries and services free to anyone on the net is truly astounding.  The barrier to entry for building production ready applications, not just trivial quote sending apps, is very low and getting lower all the time.  

Build something!

PetaPoco – Tips and Tricks

Deciding on a data layer for your application is one of the most important decisions you will make and there is no shortage of viable options.  In the .NET world you have full fledged ORM’s such as Entity Framework or NHibernate.  There are also a large number of micro-ORM’s that solve many of the pain points of writing your data layer directly while still allowing you to manually control the actual SQL used.  Last, you always have the option of rolling your own, though there are many reasons why this is not usually the right choice.  

Read More