<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Chris May</title>
  <link rel="alternate" type="text/html" href="http://chrismay.org/" />
  <link rel="self" href="http://chrismay.org/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2010-03-11T15:09:51.7214357-06:00</updated>
  <author>
    <name>Christopher May, Inc</name>
  </author>
  <subtitle>{Consulting; .Net Development; IT Services}</subtitle>
  <id>http://chrismay.org/</id>
  <generator uri="http://dasblog.info/" version="2.3.9074.18820">DasBlog</generator>
  <entry>
    <title>Customizing Style of RadGrid Edit Items</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/03/11/Customizing+Style+Of+RadGrid+Edit+Items.aspx" />
    <id>http://chrismay.org/PermaLink,guid,f5a5390d-e313-4242-aecd-48c9ea455410.aspx</id>
    <published>2010-03-11T15:08:27.0813524-06:00</published>
    <updated>2010-03-11T15:09:51.7214357-06:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/ASP.Net" label="Programming/.Net/ASP.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetASPNet.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="html">&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;A
developer&amp;nbsp;wanted to customize his “edit” form with a telerik rad grid, and we
found it less than simple to change the textboxes and other edit controls to make
them more narrow, and/or other customizations.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;I did some research and came across
a few different technique for doing this that I am going to share with everyone.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 14pt"&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Template Columns&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;The first option, which is the
one he used because it is the easiest, is to convert your columns to “template columns.” &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;Converting
columns changes:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridBoundColumn&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;DataField&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;DataType&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="System.Int32"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;HeaderText&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"&lt;/span&gt;&lt;font color=#000000&gt; &lt;span style="COLOR: blue"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;SortExpression&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="EmployeeEmail"&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;UniqueName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"
/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;To this:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridTemplateColumn&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;DataField&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"&lt;/span&gt;&lt;font color=#000000&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;HeaderText&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;SortExpression&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"&lt;/span&gt;&lt;font color=#000000&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;UniqueName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmail"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;EditItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBox&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmailTextBox"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&lt;/span&gt;&lt;font color=#000000&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;='&lt;/span&gt;&lt;font color=#000000&gt;&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt;#
Bind("EmployeeEmail") &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;'&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBox&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;EditItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="EmployeeEmailLabel"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&lt;/span&gt;&lt;font color=#000000&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;='&lt;/span&gt;&lt;font color=#000000&gt;&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt;#
Eval("EmployeeEmail") &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;'&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridTemplateColumn&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font face=Calibri&gt;&lt;font color=#000000&gt;As you can see, this gives you
control over the actual textbox item that will be displayed when you are in edit mode.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font face=Calibri&gt;&lt;font color=#000000&gt;But using template columns can
also be a bit of a pain, because you losing some of the simplicity that you had before
when you simply allowed the rad grid to deal with the details of the display/edit
cell items.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This also complicates things
when you try to do anything in the ItemDataBound or ItemCreated events on the rad
grid.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You can’t just grab the column,
you have to dig deeper, looking for the contained child controls to find your actual
edit control.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 14pt"&gt;&lt;font face=Calibri&gt;&lt;font color=#000000&gt;ItemDataBound&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; RadGrid1_ItemDataBound(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; sender &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; e &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; Telerik.Web.UI.GridItemEventArgs) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Handles&lt;/span&gt;&lt;font color=#000000&gt; RadGrid1.ItemDataBound&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;TypeOf&lt;/span&gt;&lt;font color=#000000&gt; e.Item &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; GridEditableItem &lt;/font&gt;&lt;span style="COLOR: blue"&gt;And&lt;/span&gt;&lt;font color=#000000&gt; e.Item.IsInEditMode &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; editItem &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; GridEditableItem
= e.Item&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;TypeOf&lt;/span&gt;&lt;font color=#000000&gt; editItem.Item(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"EmployeeId"&lt;/span&gt;&lt;font color=#000000&gt;).Controls(0) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; TextBox &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(editItem.Item(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"EmployeeId"&lt;/span&gt;&lt;font color=#000000&gt;).Controls(0),
TextBox).Width = 30&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font face=Calibri&gt;&lt;font color=#000000&gt;In this example, I am setting
the width of the EmployeeId textbox to only 30px.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 14pt"&gt;&lt;font face=Calibri&gt;&lt;font color=#000000&gt;CreateColumnEditor&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; RadGrid1_CreateColumnEditor(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; sender &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; e &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; Telerik.Web.UI.GridCreateColumnEditorEventArgs) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Handles&lt;/span&gt;&lt;font color=#000000&gt; RadGrid1.CreateColumnEditor&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;TypeOf&lt;/span&gt;&lt;font color=#000000&gt; e.ColumnEditor &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; GridTextBoxColumnEditor &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; e.Column.UniqueName
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"FirstName"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(e.ColumnEditor,
GridTextBoxColumnEditor).TextBoxStyle.Width = 30&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(e.ColumnEditor,
GridTextBoxColumnEditor).TextBoxControl.Style.Add(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"text-align"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"right"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;I believe this event is fired
when the grid is creating the edit columns.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You
hook into this event, and then modify the textboxstyle in order to change the look
of the edit control.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 14pt"&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Defined Column
Editor&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;You can achieve the same results
as in CreateColumnEditor without writing any code if you drop a GridTextBoxColumnEditor
on your page (outside of the RadGrid) like so:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridTextBoxColumnEditor&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="GridTextBoxColumnEditor1"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBoxStyle&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="50px"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridTextBoxColumnEditor&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;And then in your column you specify
the ID of the editor you want to use, like this:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridBoundColumn&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;DataField&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="UserId"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;DataType&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="System.Int32"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;HeaderText&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="UserId"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;ColumnEditorID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;/span&gt;&lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 12pt; mso-no-proof: yes"&gt;GridTextBoxColumnEditor1&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: red"&gt;SortExpression&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="UserId"&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: red"&gt;UniqueName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="UserId"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;telerik&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;GridBoundColumn&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;span style="mso-bookmark: _MailAutoSig"&gt;&lt;/span&gt; 
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000 size=3 face=Calibri&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=f5a5390d-e313-4242-aecd-48c9ea455410" /&gt;</content>
  </entry>
  <entry>
    <title>CSLA and the watch window</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/03/01/CSLA+And+The+Watch+Window.aspx" />
    <id>http://chrismay.org/PermaLink,guid,60506003-b8ca-4a45-bb40-5dac9fb444cf.aspx</id>
    <published>2010-03-01T16:36:14.105-06:00</published>
    <updated>2010-03-11T15:08:10.425209-06:00</updated>
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of my biggest complaints about using CSLA has been the issue of Visual Studio's
failure to work correctly in the watch window with CSLA objects.  
</p>
        <p>
I wrote a post a while back about my issues:
</p>
        <p>
          <em>So for example I have a simple list called "projects" which is of type ProjectList
containing ProjectListItems.</em>
        </p>
        <p>
          <em>If I put "projects" in the watch window, for Value I get:</em>
        </p>
        <p>
          <font color="#ff0000">
            <em>"Count = {System.TypeLoadException}"</em>
          </font>
        </p>
        <p>
          <em>If I put "projects(0)" in the watch window, I get:</em>
        </p>
        <p>
          <font color="#ff0000">
            <em>{"The generic type 'System.Collections.ObjectModel.Collection`1'
was used with the wrong number of generic arguments in assembly 'mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'." : "System.Collections.ObjectModel.Collection`1"}</em>
          </font>
        </p>
        <p>
Rocky's response was:
</p>
        <p>
          <em>This is a known issue. I've actually talked to the VS debugger team about this,
and they didn't have a satisfactory answer - and certainly not a solution. This issue
has existed since 2005 when generics were introduced into .NET.</em>
        </p>
        <p>
Well, after doing some digging I think I have come across a few work arounds.
</p>
        <p>
If I were to use the Watch Window and put:
</p>
        <p>
          <strong>projects.Count</strong>
        </p>
        <p>
it would throw an error.  But if I put:
</p>
        <p>
          <strong>projects.Count.ToString</strong>
        </p>
        <p>
then I get the correct result.
</p>
        <p>
Also when picking a specific item:
</p>
        <p>
          <strong>projects.Item(2)</strong>
        </p>
        <p>
I get the same exception.  However, if I use:
</p>
        <p>
          <strong>CType(projects.Item(2),Object)</strong>
        </p>
        <p>
I get the object as expected!
</p>
        <p>
I hope this helps out others as this is really important when debugging an application.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=60506003-b8ca-4a45-bb40-5dac9fb444cf" />
      </div>
    </content>
  </entry>
  <entry>
    <title>CSLA Validation AmbiguousMatchException</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/03/01/CSLA+Validation+AmbiguousMatchException.aspx" />
    <id>http://chrismay.org/PermaLink,guid,6886d95d-34d9-4127-826a-63e245c7a3dd.aspx</id>
    <published>2010-03-01T16:02:49.4439524-06:00</published>
    <updated>2010-03-01T16:07:40.2371052-06:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/.Net Framework" label="Programming/.Net/.Net Framework" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetNetFramework.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ran into this error today:
</p>
        <p>
failed in property IsDeleted ---&gt; System.Reflection.AmbiguousMatchException: Ambiguous
match found. at System.RuntimeType.GetPropertyImpl
</p>
        <p>
I knew that we happened to have a property on our class called IsDeleted that shadowed
a property in the CSLA base class, but I didn't think it should be running into this
problem.
</p>
        <p>
After tracking down some reference info here <a href="http://msdn.microsoft.com/en-us/library/zy0d4103.aspx">http://msdn.microsoft.com/en-us/library/zy0d4103.aspx</a> I
found otu that the issue isn't that we are shadowing, it's that we are shadowing while
at the same time changing the type.  
</p>
        <p>
The documentation seems to indicate that both situations should fail, but in my tests,
the only time I got the exception was when my shadowing property had a different type. 
In this case, we were using a Nullable(of boolean) while the CSLA element was just
a plain old Boolean.
</p>
        <p>
I guess we are going to rename our property to make things easy on ourselves, but
seeing as how this is codegenerated, it's a little more of a pain than you might think. 
But, oh well.
</p>
        <p>
Here is some code that produces the error.  If you change the 2nd property type
to a string it works ok.
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">imports</span> Microsoft.VisualBasic <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">imports</span> System <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Imports</span> System.Collections.Generic <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">module</span> MyModule
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span> Main
        <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">dim</span> target <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">new</span> baseclass
                 <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">dim</span> p <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span> system.Reflection.PropertyInfo <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> target.GetType().GetProperty(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Prop"</span>)
                 wl(
p.GetValue(target, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">nothing</span>))
         RL()     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span>     #region <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Helper
methods"</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span> WL(text <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span>)
        Console.WriteLine(text)     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span> WL(text <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span>, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">paramarray</span> args <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">object</span>())
        Console.WriteLine(text.ToString(),
args)     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span>         
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span> RL()
        Console.ReadLine()     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span>     
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span> Break()
        System.Diagnostics.Debugger.Break()
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">sub</span> #<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span> region <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">module</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> BaseBaseClass
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">readonly</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">property</span> Prop <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">string</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">get</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"BaseBaseClass"</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">get</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">property</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span> BaseClass <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">inherits</span> BaseBaseClass
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">readonly</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">property</span> Prop <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">as</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">integer</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">get</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> 123
    <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">get</span>     <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">property</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">end</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">class</span></span>
        </pre>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=6886d95d-34d9-4127-826a-63e245c7a3dd" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Javascript scope in for loops</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/02/18/Javascript+Scope+In+For+Loops.aspx" />
    <id>http://chrismay.org/PermaLink,guid,b358894a-36aa-4a84-95f9-4f21ad6cef63.aspx</id>
    <published>2010-02-18T09:44:03.602-06:00</published>
    <updated>2010-03-01T16:02:35.5535052-06:00</updated>
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
In JavaScript, you don't need to define your variables.  You can just up and
use any variable as you see fit, like this:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">asdfasdf <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 'asdfasdf';</span>
        </pre>
        <p>
However, these variables will then be created in a global scope, which is bad.
</p>
        <p>
I came across a bug today that involved for loops and globally undefined variables. 
It's not as clear what is happening when the counter variable is first used inside
the for declaration, but the result is the same: a global variable:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span> test2()
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; 10; i++) { alert(i); test3(); alert('now i is ' <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> i);
} alert('done'); } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span> test3()
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; 10; i++) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
do whatever here</span> } }</span>
        </pre>
        <p>
In this example, test2()'s for loop will only run 1 time, because test3's loop ends
up using the same variable.
</p>
        <p>
To fix this problem you need to define your looping variables:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"><strong><font size="4">var</font></strong></span> i=0;
i &lt; 10; i++)</span>
        </pre>
        <p>
This is a best practice that you should remember to do.
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=b358894a-36aa-4a84-95f9-4f21ad6cef63" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Comcast turns off your internet</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/02/14/Comcast+Turns+Off+Your+Internet.aspx" />
    <id>http://chrismay.org/PermaLink,guid,c4decfe9-7ec3-402e-8466-853c76265376.aspx</id>
    <published>2010-02-13T21:11:10.42925-06:00</published>
    <updated>2010-02-13T21:15:32.569875-06:00</updated>
    <category term="Misc" label="Misc" scheme="http://chrismay.org/CategoryView,category,Misc.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last night, all of a sudden, my internet connection went down.
</p>
        <p>
After a while, all my web requests started getting directed to a comcast page that
said:
</p>
        <p>
"You will need to activate your account"
</p>
        <p>
telling me that I needed to download some software.  Total BS.
</p>
        <p>
The link for the software didn't even work.  I tried rebooting the modem, the
router, nothing worked.
</p>
        <p>
So after an hour in a comcast support chat (using my EVDO card for internet) they
finally added my modem back to their system (or whatever).
</p>
        <p>
If you get this message, and you are not a new customer, either comcast f'ed up (which
is likely because they are possibly the worst company on earth) or you didn't pay
your bill.
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=c4decfe9-7ec3-402e-8466-853c76265376" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Skype on Mac OSX</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/02/09/Skype+On+Mac+OSX.aspx" />
    <id>http://chrismay.org/PermaLink,guid,3d695ff6-2180-45a8-9056-f8483bb3c810.aspx</id>
    <published>2010-02-09T14:31:38.663625-06:00</published>
    <updated>2010-02-09T14:33:27.273-06:00</updated>
    <category term="Misc" label="Misc" scheme="http://chrismay.org/CategoryView,category,Misc.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
My wife just tried to install Skype on her Mac OSX computer.  Of course it didn't
work.  Nothing ever works on Macs it seems.
</p>
        <p>
After lots of messing around I found some random suggestion on some forum to try this:
</p>
        <p>
1. Quit Skype<br />
2. Go to the folder “ ~/Library/Application Support/Skype/ “<br />
3. Delete the file "shared.xml"<br />
4. Start Skype 
<br /></p>
        <p>
Amazingly, this worked.
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=3d695ff6-2180-45a8-9056-f8483bb3c810" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Doing P2V with HyperV</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/01/28/Doing+P2V+With+HyperV.aspx" />
    <id>http://chrismay.org/PermaLink,guid,6f8961fd-d014-4f22-9301-51b0d5148e20.aspx</id>
    <published>2010-01-28T14:28:53.792375-06:00</published>
    <updated>2010-01-28T15:04:34.698625-06:00</updated>
    <category term="Hardware" label="Hardware" scheme="http://chrismay.org/CategoryView,category,Hardware.aspx" />
    <category term="Misc" label="Misc" scheme="http://chrismay.org/CategoryView,category,Misc.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I had recently tried to use my Windows Home Server to restore a laptop image to a
VM running inside HyperV.  
</p>
        <p>
In the event that my machine totally died (not just a hard drive issue) I could restore
the image to a VM and work from there while I got back on my feet with a new laptop.
</p>
        <p>
Unfortunately I didn't find any way to make this work.  I ended up doing all
this work and in the end, I couldn't boot.
</p>
        <p>
A disk read error occurred<br />
Press ctrl+alt+delete to restart.
</p>
        <p>
I tried everything I could think of, repairing the MBR, running fixboot, doing a windows
repair, restoring the hal dll from i386 etc.  Nothing worked.
</p>
        <p>
So I gave up on using WHS to create an instance of my dev machine, and fell back on
just trying to do a P2V of any type.
</p>
        <p>
I came across <a href="http://">Disk2VHD</a>, a free Systernals tool.  This tool
includes the options to run on the source machine while online, and also provides
an option to "Fix" the HAL (hardware abstraction layer).  I think this was part
of my original problem (the HAL issue).  My computer was setup to use SATA drivers,
and HyperV only supports virtual IDE drivers.  I think (but am not sure) that
this is what was causing my problem w/ using the WHS restore.
</p>
        <p>
So anyway, Disk2VHD runs super fast, and pretty soon I had a VHD to try out.  
</p>
        <p>
Now, this VHD didn't work either, but it would get me further along.  I would
see the windows splash screen before the black screen of death.
</p>
        <p>
What followed was a weird set of steps trying to figure out why things wouldn't work,
but in the end, I never ended up needing to disable anything.... so I'm just going
to try to write down the steps I took as best I can.
</p>
        <ol>
          <li>
After the first BSOD I booted to safe mode (using F8).</li>
          <li>
Safe mode worked, and it seemed to find some new hardware, as I would have expected,
but I don't think it found any of the drivers it needed (so maybe I had ejected the
virtual windows CD or something).</li>
          <li>
Booting normally gave the black screen of death again.</li>
          <li>
I then found this page with instructions on how to <a href="http://www.petri.co.il/forums/showthread.php?t=41390">replace
the HAL</a>.  Really these instructions were how to do Disk2VHD to a working
VM, but I had already done most of the steps except the hal replacement.  I'm
going to replace those instructions below:</li>
        </ol>
        <ol>
          <li>
            <font face="Calibri">1)</font>Downloaded Disk2VHD (v 1.3) from sysinternals (free)
and unzipped on the laptop<br /><font color="#000000"><font size="2"><font face="Calibri">2)</font>Find a place to
store the new vhd - I used a 320GB external USB, but any storage device that pc can
see and is big enough to hold your hard disk should work</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">3)</font>Run Disk2VHD and
input the name and location for the new file</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">4)</font>On your virtual
host create a new VPC (I use Virtual PC 2007) and add that new vhd you just created
as the primary hard disk.</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">5)</font>Make sure you have
an ISO of WinXP or an actual disk. If using an iso you'll need to mount it so it can
be booted from.</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">6)</font>Fire up the new
vpc and have it boot from that XP disc.</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">7)</font>Let it run setup
and then select option 2 (R) to get repair console</font></font><br /><font color="#000000"><font size="2"><font face="Calibri"><img class="inlineimg" title="Cool" border="0" alt="" src="http://www.petri.co.il/forums/images/smilies/icon_cool.gif" /></font>Login
in to windows (need admin pw)</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">9)</font>Type “cd system32”
press enter</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">10)</font>Assuming your
CD (or mounted iso) is drive D - Type “expand d:\i386\halacpi.dl_” press enter</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">11)</font>Type “copy halacpi.dll
hal.dll” press enter and then press y</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">12)</font>Reboot</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">13)</font>Press F8 to get
to safe mode</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">14)</font>After the message
that new stuff was installed, click OK for reboot</font></font><br /><font color="#000000"><font size="2"><font face="Calibri">15)</font>After system boots
back up, log in and install VM Additions</font></font></li>
        </ol>
        <li>
          <font color="#000000">IIRC I still got the black screen of death.  It's possible
that at this point behind the scenes it was doing a check of my disck or something,
but I can't tell in the VM if the HDD is going or not so I just assumed it was locked.</font>
        </li>
        <li>
          <font color="#000000">I booted to safe mode and used MSconfig to disable everything,
and also used /SOS, and some other options.</font>
        </li>
        <li>
          <font color="#000000">What followed was just a series of successful boots with me
enabling more and more until I had everything enabled and it all still worked, so
I'm not sure why I was getting the BlackSOD before I started this set of SafeMode
boots.</font>
        </li>
        <li>
          <font color="#000000">Another thing I did at some point (maybe more than once) was
try to install the VM Integration Services, which says that it's updating the HAL,
so maybe that had something to do with it too.</font>
        </li>
        <p>
          <font color="#000000">The next 2 things that I'm going to try are, running a WHS restore
to a VM that is already working (I don't think this will matter, but we'll see), and
2 trying to use the Disk2VHD on a machine that has a VHD mounted as a secondary drive. 
I don't konw if this is even possible, but I was thinking that I could use WHS to
create the VHD, mount the VHD as X: on some machine, and then tell Disk2VHD to create
a VHD from X: and instruct it to to the "Fix HAL" thing.  I'm guessing that will
not work as well, but we'll see.</font>
        </p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=6f8961fd-d014-4f22-9301-51b0d5148e20" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Connecting dynamically to mygeneration MyMeta.dbRoot</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/01/18/Connecting+Dynamically+To+Mygeneration+MyMetadbRoot.aspx" />
    <id>http://chrismay.org/PermaLink,guid,d2c7c4a3-54d7-4931-803e-b22d09a2484c.aspx</id>
    <published>2010-01-18T00:42:39.536-06:00</published>
    <updated>2010-01-18T09:43:49.521-06:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
The amount of time that this cost me is astounding for such a stupid issue. 
(And, I'm going to lay the blame fully on whoever wrote the dbRoot object in the MyGeneration
project.  Total improper use of properties).
</p>
        <p>
The situation was this: I was trying to dynamically wire up all the plumbing that
the mygeneration windows app does for you manually from the ZeusCmd command line.
</p>
        <p>
Doing this would allow me to switch from DB to DB within my code gen application.
</p>
        <p>
Because ZeusCmd runs first (it references my app and passes in what is needed), if
you had previously saved a connection in your MyGeneration app, then this connection
is used when ZeusCmd runs.  I didn't want this to happen because as I move from
location to location different DB servers are available or not available, so if the
last DB server I connected to was at office A, I didn't want my code gen crashing
onload when I am out of said office.
</p>
        <p>
So I ran MyGeneration and changed my connection to be &lt;None&gt; and saved the settings. 
Then in my code gen, I tried to manually create the dbRoot object (named meta here)
that was previously created for me my ZeusCmd and my saved MyGeneration settings.
</p>
        <p>
Code like this:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">meta.Connect(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SQL"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Provider=SQLNCLI;Server=cmayt61p;Database=DBName;Trusted_Connection=yes;"</span>)</span>
        </pre>
        <p>
Seemed to do the trick. 
</p>
        <p>
However, my codegen started blowing up on my later in the process.  After tracking
down the error I find that the mygeneration result column object can't figure out
the .net type that would be the same as a sql server "int".  Strange, never had
these problems before.
</p>
        <p>
A lot of debugging leads me to find that:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">meta.DbTarget
meta.Language </span>
        </pre>
        <p>
Are both returning "" when before they were returning "SqlClient" and "VB.NET" when
I was not dynamically connecting.
</p>
        <p>
So here is where things get bad... anytime I try setting these properties to their
values:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">meta.DbTarget <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SqlClient"</span> meta.Language <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"VB.NET"</span></span>
        </pre>
        <p>
Nothing happens.  The values don't appear to stick.
</p>
        <p>
Eventually I even start trying to set the LanguageMappingFileName and DbTargetMappingFileName
properties as well:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">meta.DbTarget <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SqlClient"</span> meta.Language <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"VB.NET"</span> meta.LanguageMappingFileName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"C:\Program
Files\MyGeneration13\Settings\Languages.xml"</span> meta.DbTargetMappingFileName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"C:\Program
Files\MyGeneration13\Settings\DbTargets.xml"</span></span>
        </pre>
        <p>
I tried doing these property sets before connecting and after connecting.
</p>
        <p>
I tried returning to having MyGeneration setup the meta object form me (and all
these properties have their values) before dynamically connecting (and losing the
DbTarget and Language property values).
</p>
        <p>
I even tried creating a brand new dbRoot object, as well as trying to read some hidden
values in the IZeusInput object.
</p>
        <p>
But, in the end, it all came down to the this 1 little thing:
</p>
        <p>
You have to set the mapping file properties before you can set the DbTarget and Language
properties.
</p>
        <p>
So this will work just fine:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">meta.Connect(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SQL"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Provider=SQLNCLI;Server=cmayt61p;Database=MSiUpgraded;Trusted_Connection=yes;"</span>)<br />
meta.LanguageMappingFileName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"C:\Program
Files\MyGeneration13\Settings\Languages.xml"</span> meta.DbTargetMappingFileName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"C:\Program
Files\MyGeneration13\Settings\DbTargets.xml"</span> meta.DbTarget <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SqlClient"</span> meta.Language <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"VB.NET"</span></span>
        </pre>
        <p>
But this won't:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">meta.Connect(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SQL"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Provider=SQLNCLI;Server=cmayt61p;Database=MSiUpgraded;Trusted_Connection=yes;"</span>)<br />
meta.DbTarget <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"SqlClient"</span> meta.Language <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"VB.NET"</span> meta.LanguageMappingFileName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"C:\Program
Files\MyGeneration13\Settings\Languages.xml"</span> meta.DbTargetMappingFileName <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"C:\Program
Files\MyGeneration13\Settings\DbTargets.xml"</span></span>
        </pre>
        <p>
It just so happened that everywhere that I was testing this stuff in my code, I always
set the DbTarget and Language properties first, and they would never stick.
</p>
        <p>
This is not a proper use of properties.  If a property set has conditional logic
that will prevent it from setting, there is something wrong here.  At minimum
something should happen, an exception being thrown maybe?  The proper thing to
do in my mind would be to make DbTarget and Language readonly properties and have
functions to set their value, which could return something indicating failure (or
throw an exception).
</p>
        <p>
Property gets and sets should do just that, get and set properties.  There shouldn't
be logic in there deciding if and when to actually perform the set that you have coded. 
That is the job of a function.
</p>
        <p>
          <strong>UPDATE: </strong>And I discovered as well that you have to connect first before
you set any of these values, or none of them will stick.  So you have to 1) connect
2) set the file paths 3) set the language and dbtargets, in that order or nothing
works.<br /></p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=d2c7c4a3-54d7-4931-803e-b22d09a2484c" />
      </div>
    </content>
  </entry>
</feed>