<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4072715827401382932</id><updated>2024-10-24T18:03:32.795-04:00</updated><category term="Kendo UI Grid"/><category term="MVC3"/><category term="Razor"/><category term="C#"/><category term="Databases"/><category term="Detail Template"/><category term="FindControl"/><category term="Onion Architecture"/><category term="RadComboBox"/><category term="RadGrid"/><title type='text'>Lil&#39; Bits of Code</title><subtitle type='html'>Just my place to post interesting coding tid bits, solutions to coding problems I&#39;ve encountered, etc...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-4592920900389624530</id><published>2013-05-21T10:05:00.002-04:00</published><updated>2013-05-21T10:05:39.540-04:00</updated><title type='text'>Write clean code. It should be mandatory!</title><content type='html'>So I&#39;m several months in to my latest job and into my first experience digging into other peoples code. Before this I&#39;ve always been rather fortunate and created code from scratch and was able to set forth the guidelines of how it should look, etc.&lt;br /&gt;
&lt;br /&gt;
This time around, I get to play with other peoples code and what I found was not pretty at all. And I don&#39;t mean pretty as in it didn&#39;t &quot;look&quot; nice. This code base essentially followed everything that defined &quot;bad code&quot;. It would be a prime example of it actually. Everything from Hungarian notation, using anything but SOLID principles and useless commenting and leftover dead code scattered everywhere. And that&#39;s just the beginning. Yes, it&#39;s THAT bad. It needs major&amp;nbsp;re-factoring and lots of&amp;nbsp;TLC.&lt;br /&gt;
&lt;br /&gt;
That being said, as a professional developer, clean code should be one of your top priorities. And just what is clean code? That in itself is a topic made for a book. Which is something that fortunately&amp;nbsp;has already been written. Check out the following book and see if you can spot any of your bad habits.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.e-reading-lib.org/bookreader.php/134601/Clean_Code_-_A_Handbook_of_Agile_Software_Craftsmanship.pdf&quot;&gt;Clean Code - A Handbook of Agile Software Craftsmanship&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Clean code = code that&#39;s easy to follow, debug and less prone to having bugs in the first place. Make it your priority!</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/4592920900389624530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/05/write-clean-code-it-should-be-mandatory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4592920900389624530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4592920900389624530'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/05/write-clean-code-it-should-be-mandatory.html' title='Write clean code. It should be mandatory!'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-4673335485117814808</id><published>2013-02-06T09:24:00.000-05:00</published><updated>2013-02-06T09:24:04.501-05:00</updated><title type='text'>Google acquires Channel Intelligence</title><content type='html'>It&#39;s official. The company I&#39;ve been working for the past 9 months has finally been acquired. By Google no less. Quite a feat for a small company.&amp;nbsp;&lt;a href=&quot;http://www.linkedin.com/redirect?url=http%3A%2F%2Flnkd%2Ein%2FpdNipX&amp;amp;urlhash=edAB&amp;amp;_t=commentary-share-link&amp;amp;trk=commentary-share-link&quot; style=&quot;background-color: white; border: 0px; color: #0073b2; font-family: Arial, sans-serif; font-size: 12.727272033691406px; line-height: 16.988636016845703px; margin: 0px; outline: 0px; padding: 0px; text-decoration: initial; vertical-align: baseline;&quot; target=&quot;_blank&quot;&gt;http://lnkd.in/pdNipX&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/4673335485117814808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/google-acquires-channel-intelligence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4673335485117814808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4673335485117814808'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/google-acquires-channel-intelligence.html' title='Google acquires Channel Intelligence'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-9166950613802112870</id><published>2013-02-04T11:46:00.002-05:00</published><updated>2013-02-04T11:47:52.533-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Onion Architecture"/><title type='text'>Onion Architecture</title><content type='html'>If you haven&#39;t heard about the Onion Archtecture, you really should spend a few moments to check it out. If you develop code using n-tier archtectures this may just be the future...&lt;br /&gt;
&lt;br /&gt;
Check out my long time friend &amp;amp; coworker&#39;s blog on the subject:&amp;nbsp;http://www.jackpines.info/&lt;br /&gt;
&lt;br /&gt;
He&#39;s got slides explaining the architecture &amp;amp; it&#39;s benefits over traditional layered/tiered and even has a template created to help you get started. Definitely worth the time and you may just use it for your next big project. I know I will!</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/9166950613802112870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/onion-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/9166950613802112870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/9166950613802112870'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/onion-architecture.html' title='Onion Architecture'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-8047818115999645396</id><published>2013-02-04T11:41:00.002-05:00</published><updated>2013-02-04T11:48:37.916-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Detail Template"/><category scheme="http://www.blogger.com/atom/ns#" term="Kendo UI Grid"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC3"/><category scheme="http://www.blogger.com/atom/ns#" term="Razor"/><title type='text'>Using a detailed template in a Kendo UI grid...</title><content type='html'>Just a note to myself (and this may be useful to someone else). This was using MVC3/Razor with a Kendo UI grid control. Special gotcha&#39;s in &lt;span style=&quot;color: red;&quot;&gt;RED&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To use a detailed template in a kendo grid…&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Specify the template id in the grid you are creating&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background: yellow; font-family: Consolas; font-size: 9.5pt; mso-highlight: yellow;&quot;&gt;@(&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;Html.Kendo().Grid&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;PortalRolesModel&lt;/span&gt;&amp;gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-autospace: none; text-indent: .5in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Name(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;roleGrid&quot;&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Wingdings; font-size: 9.5pt;&quot;&gt;à&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &amp;nbsp;.ClientDetailTemplateId(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;roleDetailTemplate&quot;&lt;/span&gt;)
&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Wingdings; font-size: 9.5pt;&quot;&gt;ß&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-autospace: none; text-indent: .5in;&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Columns(columns =&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;columns.Bound(c =&amp;gt; c.RoleName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
columns.Bound(c =&amp;gt; c.UsersInRole).Width(100).HtmlAttributes(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; { style = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;text-align:
center;&quot;&lt;/span&gt; });&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; })&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Pageable()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Sortable()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.DataSource(dataSource =&amp;gt; dataSource&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;.Ajax()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Read(read =&amp;gt; read.Action(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;RoleSelect&quot;&lt;/span&gt;,
&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;AccountAdministration&quot;&lt;/span&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Model(model =&amp;gt; model.Id(p =&amp;gt; p.RoleName)))&lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Then script the template for the detailed view:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;roleDetailTemplate&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/kendo-tmpl&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;@(&lt;/span&gt;Html.Kendo().Grid&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;SelectUserModel&lt;/span&gt;&amp;gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; .Name(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Roles_#=RoleName#&quot;&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.ToolBar(toolbar=&amp;gt;toolbar.Create().Text(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Add
User To Role&quot;&lt;/span&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Columns(columns
=&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;columns.Bound(ud =&amp;gt;
ud.UserName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;columns.Bound(ud =&amp;gt;
ud.LastLoginDate).Format(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;{0:dd MMM yyyy
hh:mm:ss tt}&quot;&lt;/span&gt;).Width(170);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;columns.Bound(c =&amp;gt;
c.IsOnline)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Title(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Online&quot;&lt;/span&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Wingdings; font-size: 9.5pt;&quot;&gt;à&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; .ClientTemplate(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&lt;a href=&quot;file://%23%3D%20isonline%20%3F%20%27%26%2310003%3B%27%20:%20%27%27%20/%23&quot;&gt;\\#=
IsOnline ? &#39;&amp;amp;#10003;&#39; : &#39;&#39; \\#&lt;/a&gt;&quot;&lt;/span&gt;) &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Wingdings; font-size: 9.5pt;&quot;&gt;ß&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; Must use \\# in client
templates in a detailed&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt;template
for this to work as just # won’t do anything.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.HtmlAttributes(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; { style = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;text-align:center;&quot;&lt;/span&gt;
})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Width(50);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;columns.Command(commands =&amp;gt;
commands.Destroy().Text(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Remove&quot;&lt;/span&gt;)).Width(95);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Editable(editable
=&amp;gt; editable.Mode(&lt;span style=&quot;color: #2b91af;&quot;&gt;GridEditMode&lt;/span&gt;.PopUp).DisplayDeleteConfirmation(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Remove user from role?&quot;&lt;/span&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.DataSource(dataSource =&amp;gt; dataSource&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Ajax()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Read(read =&amp;gt; read.Action(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;UsersInRolesHierarchyAjax&quot;&lt;/span&gt;,
&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;AccountAdministration&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; { roleName = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;#=RoleName#&quot;&lt;/span&gt;
}))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Create(create =&amp;gt; create.Action(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;AddUserToRole&quot;&lt;/span&gt;,
&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;AccountAdministration&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; { roleName = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;#=RoleName#&quot;&lt;/span&gt;
}))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Destroy(destroy =&amp;gt; destroy.Action(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;RemoveUserFromRole&quot;&lt;/span&gt;,
&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;AccountAdministration&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; { roleName = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;#=RoleName#&quot;&lt;/span&gt;
}))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
.Model(model =&amp;gt; model.Id(p =&amp;gt; p.UserName)))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Wingdings; font-size: 9.5pt;&quot;&gt;à&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; .ToClientTemplate()&lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;)&lt;/span&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Wingdings; font-size: 9.5pt;&quot;&gt;ß&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: red; font-family: Consolas; font-size: 9.5pt;&quot;&gt; IMPORTANT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/8047818115999645396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/using-detailed-template-in-kendo-ui-grid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/8047818115999645396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/8047818115999645396'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/using-detailed-template-in-kendo-ui-grid.html' title='Using a detailed template in a Kendo UI grid...'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-105950964164530524</id><published>2013-02-04T11:38:00.002-05:00</published><updated>2013-02-04T11:49:00.606-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kendo UI Grid"/><category scheme="http://www.blogger.com/atom/ns#" term="MVC3"/><category scheme="http://www.blogger.com/atom/ns#" term="Razor"/><title type='text'>Cell formatting. Reducing the size of text in a Kendo UI grid.</title><content type='html'>Here&#39;s something I ran into while using MVC3/Razor &amp;amp; Kendo UI by Telerik. I needed a way to minimize what was shown in the grid cells. In my case I wanted to shorten the width of a column containing email addresses. Since there aren&#39;t spaces in email addresses, word wrapping is not going to happen.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So here&#39;s how I went about it (using Kendo UI Grid (MVC Template version)):&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To shorten the length of an email address displayed in a row
so it will fit better I did the following (same method can be applied to
shorten a paragraph or other text):&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
I bind my column in my grid and applied a client template.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;columns.Bound(c =&amp;gt; c.Email).ClientTemplate(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;.Format(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: mediumseagreen;&quot;&gt;{0}&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;...&quot;&lt;/span&gt;,
&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;#= formatter(Email) #&quot;&lt;/span&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
I wrote a javascript function to handle the formatting: &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt;
formatter(value) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; value.substring(0, 10);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-family: Consolas; font-size: 9.5pt;&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/105950964164530524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/cell-formatting-reducing-size-of-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/105950964164530524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/105950964164530524'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/cell-formatting-reducing-size-of-text.html' title='Cell formatting. Reducing the size of text in a Kendo UI grid.'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-8253989687436085419</id><published>2013-02-04T11:32:00.001-05:00</published><updated>2013-02-04T11:32:09.789-05:00</updated><title type='text'>Yikes!</title><content type='html'>Wow.. Almost 2 years have passed since my last post. A lot has changed since then too. I&#39;m not an avid blogger but I&#39;ve sure used more than a few blogs to research issues I&#39;ve come across that I couldn&#39;t quite find anywhere else. Maybe I&#39;ll continue to do so, only time will tell...</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/8253989687436085419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/yikes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/8253989687436085419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/8253989687436085419'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2013/02/yikes.html' title='Yikes!'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-5720823803686300318</id><published>2011-03-26T21:37:00.000-04:00</published><updated>2011-03-26T21:37:07.582-04:00</updated><title type='text'>Go to a Code Camp!!</title><content type='html'>I went to the Orlando .NET Code Camp this year (as well as last year) and picked up quite a few tid bits of information. They put on a great event and I even walked away with a few thousand dollars in software licenses for FREE. Can&#39;t beat that deal!&lt;br /&gt;
&lt;br /&gt;
If you have an event in your area, I suggest you attend and who knows what you might get out of it :)</content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/5720823803686300318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/go-to-code-camp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/5720823803686300318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/5720823803686300318'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/go-to-code-camp.html' title='Go to a Code Camp!!'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-4667622552703455566</id><published>2011-03-23T23:06:00.000-04:00</published><updated>2011-03-23T23:13:30.685-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FindControl"/><category scheme="http://www.blogger.com/atom/ns#" term="RadComboBox"/><category scheme="http://www.blogger.com/atom/ns#" term="RadGrid"/><title type='text'>Finding a Control within a RadGrid Edit Template</title><content type='html'>&lt;p&gt;I’ve recently needed to incorporate a RadGrid in which my edit template contained two RadComboBoxes. Depending on the value of my first combo box, the second would be updated with different sets of data. The problem I ran into was how to connect to this second combo box so I can bind it with data.&lt;/p&gt; &lt;p&gt;Here’s the basic premise:&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;RadComboBox combo1 = (RadComboBox)sender;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;GridEditFormItem editItem = (GridEditFormItem)combo1.NamingContainer;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;RadComboBox combo2 = (RadComboBox)editItem.FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;RadComboBox2&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;csharpcode&quot;&gt;And the more complete code sample here:&lt;/div&gt;&lt;br&gt;&lt;br /&gt;&lt;p&gt;ASPX -- &lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;lt;telerik:RadGrid ID=&lt;span style=&quot;color: #006080&quot;&gt;&quot;RadGrid1&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;  &amp;lt;MasterTableView EditMode=&lt;span style=&quot;color: #006080&quot;&gt;&quot;EditForms&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &amp;lt;EditFormSettings EditFormType=&lt;span style=&quot;color: #006080&quot;&gt;&quot;Template&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;      &amp;lt;FormTemplate&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &amp;lt;telerik:RadComboBox ID=&lt;span style=&quot;color: #006080&quot;&gt;&quot;RadComboBox1&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&quot;server&quot;&lt;/span&gt; AutoPostBack=&lt;span style=&quot;color: #006080&quot;&gt;&quot;true&quot;&lt;/span&gt; OnSelectedIndexChanged=&lt;span style=&quot;color: #006080&quot;&gt;&quot;RadComboBox1_OnSelectedIndexChanged&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;          &amp;lt;Items&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &amp;lt;telerik:RadComboBoxItem Text=&lt;span style=&quot;color: #006080&quot;&gt;&quot;Selection 1&quot;&lt;/span&gt; Value=&lt;span style=&quot;color: #006080&quot;&gt;&quot;1&quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;            &amp;lt;telerik:RadComboBoxItem Text=&lt;span style=&quot;color: #006080&quot;&gt;&quot;Selection 2&quot;&lt;/span&gt; Value=&lt;span style=&quot;color: #006080&quot;&gt;&quot;2&quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;          &amp;lt;/Items&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &amp;lt;/telerik:RadComboBox&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &amp;lt;telerik:RadComboBox ID=&lt;span style=&quot;color: #006080&quot;&gt;&quot;RadComboBox2&quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&quot;server&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;        &amp;lt;/telerik:RadComboBox&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;      &amp;lt;/FormTemplate&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &amp;lt;/EditFormSettings&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;  &amp;lt;/MasterTableView&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;lt;/telerik:RadGrid&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br /&gt;&lt;div class=&quot;csharpcode&quot;&gt;Code-behind --&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; RadComboBox1_OnSelectedIndexChanged(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, RadComboBoxSelectedIndexChangedEventArgs e)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    RadComboBox combo1 = (RadComboBox)sender;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    GridEditFormItem editItem = (GridEditFormItem)combo1.NamingContainer;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    RadComboBox combo2 = (RadComboBox)editItem.FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;RadComboBox2&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;switch&lt;/span&gt;(e.Value)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    {    &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&quot;1&quot;&lt;/span&gt;:&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;          combo2.Items.Add(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; RadComboBoxItem(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Test&quot;&lt;/span&gt;));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;          &lt;span style=&quot;color: #0000ff&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;       &lt;span style=&quot;color: #0000ff&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&quot;2&quot;&lt;/span&gt;:&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;          combo2.Items.Add(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; RadComboBoxItem(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Test Again&quot;&lt;/span&gt;));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;          &lt;span style=&quot;color: #0000ff&quot;&gt;break&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;csharpcode&quot;&gt;&lt;br&gt;&lt;br&gt;Good luck :)&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/4667622552703455566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/finding-control-within-radgrid-edit.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4667622552703455566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4667622552703455566'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/finding-control-within-radgrid-edit.html' title='Finding a Control within a RadGrid Edit Template'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-680681817202774275</id><published>2011-03-16T17:41:00.001-04:00</published><updated>2011-03-16T20:24:43.044-04:00</updated><title type='text'>Calling a function in a ASP.Net User Control from another User Control on the same page</title><content type='html'>&lt;p&gt;I recently had to develop a web application in which a page consisted of several user controls. One of the problems I encountered during the development of this page is that I needed User Control A to perform some bit of work, then pass of results and post them into User Control B.&lt;/p&gt; &lt;p&gt;I spent the better part of a day trying to find decent documentation on how to achieve this feat. &lt;/p&gt; &lt;p&gt;You would think you can simply do something like this from User Control A during a button click for example:&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;ControlB ctrlB = (ControlB)Page.FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;cB&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;DropDownList ddl = ctrlB.ControlB_DDL;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;txtDDLValue.Text = ddl.SelectedValue;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br /&gt;&lt;p&gt;And as long as both controls are referenced on the page this works fine. Unfortunately this is not the case. This would be too easy. While this may work in some situations, it doesn’t seem to hold together well if master pages are used. And in my case nested master pages.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;What to do… Well I continued researching and found several interesting articles about using delegates, event bubbling and all sorts of crazy things just to do one relatively simple task. Most of these articles (mostly blog entries) were so bad and hard to follow they aren’t worth reposting here.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In any event, I finally found a solution that worked for my needs. Instead of attempting something difficult and knowing .FindControl(..) wouldn’t work I found out about using .NamingContainer. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;In my case my page consisted of a master page, a nested master page, an asp:Panel with an ID=”Data” on the page itself which housed my (destination)user control, and my user control in which I want to to modify data on, and finally the control itself living in that user control.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This code snippet is something I called during an InsertCommand event for a Telerik RadGrid control I happen to be using and takes the little info I want and adds it to a CheckBoxList control housed with my other user control.&lt;/p&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;CheckBoxList improvementsAddressed = (CheckBoxList)Grid_Improvement&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    .NamingContainer&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    .NamingContainer&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    .FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Data&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    .FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;ImprovementsAddressed&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;    .FindControl(&lt;span style=&quot;color: #006080&quot;&gt;&quot;CheckBoxList_ImprovementsAddressed&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;improvementsAddressed.Items.Add(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; ListItem(improvement, guid));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I could go into more elaborate detail, but since I’m new to this blogging thing, I’m not even sure if anyone will actually read it. Feel free to leave a comment if you need more details and/or help. But hopefully there’s enough info here to point you in the right direction to get you an elegant solution to your problem.&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/680681817202774275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/calling-function-in-aspnet-user-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/680681817202774275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/680681817202774275'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/calling-function-in-aspnet-user-control.html' title='Calling a function in a ASP.Net User Control from another User Control on the same page'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-2965098875483684932</id><published>2011-03-16T16:32:00.000-04:00</published><updated>2011-03-16T16:33:05.371-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Databases"/><title type='text'>Instant Oracle Using C#</title><content type='html'>&lt;p&gt;I’m amazed that people actually find the time to blog. I set this blog site up 2 or 3 weeks ago, have plenty of code to blog about but have been busy coding at my day job (and sometimes night job) that I haven’t had much time at all to even think about this.&lt;/p&gt; &lt;p&gt;Anyhow, the topic is about Oracle &amp;amp; C#, not my daily work load. I wrote up this article several years ago, when I actually did have more time and it’s apparently still getting plenty of good use today.&lt;/p&gt; &lt;p&gt;You can view the article here at codeproject.com: &lt;a href=&quot;http://www.codeproject.com/KB/database/C__Instant_Oracle.aspx&quot; target=&quot;_blank&quot;&gt;Instant Oracle Using C#&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I myself haven’t worked with Oracle databases for quite some time, but if you find you need to this article will help you get a project started.&lt;/p&gt; &lt;p&gt;Enjoy :)&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/2965098875483684932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/instant-oracle-using-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/2965098875483684932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/2965098875483684932'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/03/instant-oracle-using-c.html' title='Instant Oracle Using C#'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4072715827401382932.post-4336559894649828617</id><published>2011-02-27T20:50:00.000-05:00</published><updated>2011-03-16T22:32:55.770-04:00</updated><title type='text'>Ehhhh... Now what??</title><content type='html'>Ok, I&#39;ve made it to the world o&#39; blog... &lt;br&gt;&lt;br&gt;Now what?!?! Guess I should blog about what I know best. Or at least can talk somewhat intelligently about. Well, that&#39;s the plan anyway...  &lt;p&gt;At the very least, I may be able to share some of my expertise (or lack thereof) Who knows, I may be completely wrong, but either way somebody will learn something. Anyhow, this blog is inspired by an old post I made to a site called &lt;a href=&quot;http://www.codeproject.com/&quot; target=&quot;_blank&quot;&gt;&lt;font color=&quot;#a5a5a5&quot;&gt;CodeProject.com&lt;/font&gt;&lt;/a&gt; which has been helping millions of people in my profession with all things code. &lt;/p&gt; &lt;p&gt;The article I wrote entitled “&lt;a href=&quot;http://www.codeproject.com/KB/database/C__Instant_Oracle.aspx&quot; target=&quot;_blank&quot;&gt;&lt;font color=&quot;#f79646&quot;&gt;Instant Oracle Using C#&lt;/font&gt;&lt;/a&gt;” is something I wrote after having created an application that needed to connect to a database. At the time, information on the subject was scarce so I thought I’d take a stab at it and I thought I did rather well. Having had over 150,000 page views in just under 4 years and 50-200 hits daily is pretty impressive given it’s just one article. So I thought I’d put this together so I can post bits of code I used to solve whatever problem I happen to be working on. Postings may be scare given time constraints of work &amp;amp; family life, but who knows… I may just post something that may just help you and that’s good enough for me!&lt;/p&gt; &lt;p align=&quot;center&quot;&gt;&lt;img style=&quot;border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none&quot; class=&quot;wlEmoticon wlEmoticon-smile&quot; alt=&quot;Smile&quot; src=&quot;http://lh5.ggpht.com/_WEBadfDqf7U/TYFy1wRgCcI/AAAAAAAAABI/gxRo4gdLqrU/wlEmoticon-smile%5B2%5D.png?imgmax=800&quot;&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://lilbitsofcode.blogspot.com/feeds/4336559894649828617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/02/ehhhh-now-what.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4336559894649828617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4072715827401382932/posts/default/4336559894649828617'/><link rel='alternate' type='text/html' href='http://lilbitsofcode.blogspot.com/2011/02/ehhhh-now-what.html' title='Ehhhh... Now what??'/><author><name>LilBitsOfCode</name><uri>http://www.blogger.com/profile/03261775789809347879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_WEBadfDqf7U/TYFy1wRgCcI/AAAAAAAAABI/gxRo4gdLqrU/s72-c/wlEmoticon-smile%5B2%5D.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry></feed>