Cascading DropDownLists Inside Telerik RadGrid

Written by rsolberg on. Posted in All, Software Development, Technology

One of the things I’ve always enjoyed about the Telerik controls is that they do things out of the box quicker than the standard ASP.NET controls, but if you venture off the beaten path just a step or two you might be entering hell… I literally spent hours googling yesterday trying to find where someone else had actually accomplished this feat and much to my surprise, I had to pick and pull a line of code or two from 7 different sources just to get to a place where I knew I could finish what I was working on. Perhaps this post will save you all some time… I think this example below is very practical. Many of us work on systems that store addresses and there are times when you need to have a state trigger a refresh to the counties dropdownlist or perhaps you have a country dropdownlist that should trigger changes to a state/province dropdownlist.

The ASPX Code

Code Behind Functions

Here are a couple of important things to note…
  1. You need to make sure automatic inserts and updates are set to false so that your code behind can execute these actions. ¬†AllowAutomaticInserts=”False” AllowAutomaticUpdates=”False”
  2. Make sure your DataKeyNames include all the required keys.
Be Sociable, Share!

Tags: , , , , , , ,

Trackback from your site.

Leave a comment

© Copyright RSolberg, 2003 - 2014. All Rights Reserved