{.NET + SQL_Server + Azure + devLeadership + technology}

Menu

Monthly Archives: April 2015

We recently ran into an issue where we needed to get a reference to a telerik control on the client side but that control was going to be inside a grid or repeater so that there would be many copies all with unique generated IDs. It

looked like maybe the function $telerik.findControl could work for us, but there was limited documentation and I couldn’t find a single example online of someone successfully using it. Pretty much every post I cam across had the person being routed to some other more convoluted work around rather than addressing why their findControl call wasn’t working. So after getting it working I figured I’d give a quick explaination.

So just to be very clear, domElementOfSomeParent is an HTML DOM object that you can get from javascript or jquery or whatever. It defines the scope for the search for the control. Only elements that are ancestor (children, grand children etc) of domElementOfSomeParent will be considered. And controlIdFromServerSide is a string that is the same as the ID you are specifying on the server, even if that ID is for a control that is going to be rendered multiple times because it’s in some gridview or repeater.

Here is an interesting way I came across online of someone using responsive CSS to deal with tables. Once the window width gets below 700px it switches from a table to more of a list of tables where each table becomes a row in the previous table.

Just a quick tip. If you are ever debugging an MVC Action where you are passing JSON directly to the server (or for that matter where you are debugging anything complicated enough that you care about the raw data being passed to your method) I found this to be helpful.

Run this code in the debugger (or you can just paste it into a Watch item)

Request.InputStream.Position = 0

And then you can add this as a watch item

new System.IO.StreamReader(Request.InputStream).ReadToEnd()

This will write out the entire raw input data, which is very helpful if you want to see the exact JSON being passed to your method.