<?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: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-9199272216035429677</id><updated>2011-11-27T16:17:27.524-08:00</updated><category term='Winform'/><title type='text'>Microsoft Windows forms - Winform Interview Questions And answers</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://winformfaqs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://winformfaqs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9199272216035429677.post-3980925408433686797</id><published>2008-10-20T02:44:00.000-07:00</published><updated>2008-12-22T21:17:15.756-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Winform'/><title type='text'>Interview Questions  .NET Windows Forms   </title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Body Text Indent"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Hyperlink"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="HTML Preformatted"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman";} pre 	{mso-style-noshow:yes; 	mso-style-unhide:no; 	mso-style-link:"HTML Preformatted Char"; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} span.HTMLPreformattedChar 	{mso-style-name:"HTML Preformatted Char"; 	mso-style-noshow:yes; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"HTML Preformatted"; 	font-family:"Courier New"; 	mso-ascii-font-family:"Courier New"; 	mso-hansi-font-family:"Courier New"; 	mso-bidi-font-family:"Courier New";} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1469742420; 	mso-list-template-ids:-995558110;} @list l0:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Write a simple Windows      Forms MessageBox statement.&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;System.Windows.Forms.MessageBox.Show&lt;br /&gt; &lt;!--[if !supportLineBreakNewLine]--&gt;&lt;br /&gt; &lt;!--[endif]--&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;  &lt;/span&gt;("Hello, Windows Forms");&lt;/pre&gt;  &lt;ol start="4" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;a name="more62"&gt;&lt;/a&gt;&lt;b&gt;Can you      write a class without specifying namespace? Which namespace does it belong      to by default?&lt;/b&gt;?&lt;br /&gt;     Yes, you can, then the class belongs to global namespace which has no      name. For commercial products, naturally, you wouldn’t want global      namespace. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;You are designing a GUI      application with a window and several widgets on it. The user then resizes      the app window and sees a lot of grey space, while the widgets stay in      place. What’s the problem?&lt;/b&gt; One should use anchoring for correct      resizing. Otherwise the default property of a widget on a form is      top-left, so it stays at the same location when resized. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How can you save the      desired properties of Windows Forms application?&lt;/b&gt; .config files in .NET      are supported through the API to allow storing and retrieving information.      They are nothing more than simple XML files, sort of like what .ini files      were before for Win32 apps. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;So how do you retrieve the      customized properties of a .NET application from XML .config file?&lt;/b&gt;      Initialize an instance of AppSettingsReader class. Call the GetValue      method of AppSettingsReader class, passing in the name of the property and      the type expected. Assign the result to the appropriate variable. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Can you automate this      process?&lt;/b&gt; In Visual Studio yes, use Dynamic Properties for automatic      .config creation, storage and retrieval. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;My progress bar freezes up      and dialog window shows blank, when an intensive background process takes      over&lt;/b&gt;. Yes, you should’ve multi-threaded your GUI, with taskbar and      main form being one thread, and the background process being the other. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What’s the safest way to      deploy a Windows Forms app?&lt;/b&gt; Web deployment: the user always downloads      the latest version of the code; the program runs within security sandbox,      properly written app will not require additional security privileges. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Why is it not a good idea      to insert code into InitializeComponent method when working with Visual      Studio?&lt;/b&gt; The designer will likely throw it away; most of the code      inside InitializeComponent is auto-generated. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What’s the difference      between WindowsDefaultLocation and WindowsDefaultBounds?&lt;/b&gt;      WindowsDefaultLocation tells the form to start up at a location selected      by OS, but with internally specified size. WindowsDefaultBounds delegates      both size and starting position choices to the OS. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What’s the difference      between Move and LocationChanged? Resize and SizeChanged?&lt;/b&gt; Both methods      do the same, Move and Resize are the names adopted from VB to ease      migration to C#. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How would you create a      non-rectangular window, let’s say an ellipse?&lt;/b&gt; Create a rectangular      form, set the TransparencyKey property to the same value as BackColor,      which will effectively make the background of the form transparent. Then      set the FormBorderStyle to FormBorderStyle.None, which will remove the      contour and contents of the form. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How do you create a      separator in the Menu Designer?&lt;/b&gt; A hyphen ‘-’ would do it. Also, an      ampersand ‘&amp;amp;\’ would underline the next letter. &lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How’s anchoring different      from docking?&lt;/b&gt; Anchoring treats the component as having the absolute      size and adjusts its location relative to the parent form. Docking treats      the component location as absolute and disregards the component size. So      if a status bar must always be at the bottom no matter what, use docking.      If a button should be on the top right, but change its position with the      form being resized, use anchoring. &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9199272216035429677-3980925408433686797?l=winformfaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://winformfaqs.blogspot.com/feeds/3980925408433686797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9199272216035429677&amp;postID=3980925408433686797' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default/3980925408433686797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default/3980925408433686797'/><link rel='alternate' type='text/html' href='http://winformfaqs.blogspot.com/2008/10/interview-questions-net-windows-forms.html' title='Interview Questions  .NET Windows Forms   '/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9199272216035429677.post-1410179820195198378</id><published>2008-10-20T02:27:00.001-07:00</published><updated>2008-12-22T21:17:15.756-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Winform'/><title type='text'>WinForms FAQs</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_editdata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;link rel="themeData" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///D:%5CUSERPR%7E1%5Csshende%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="0" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="0" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Hyperlink"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="Normal (Web)"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Tahoma; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:1627400839 -2147483648 8 0 66047 0;} @font-face 	{font-family:Geneva; 	panose-1:0 0 0 0 0 0 0 0 0 0; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:3 0 0 0 1 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman","serif"; 	mso-fareast-font-family:"Times New Roman";} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman","serif";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: maroon;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: maroon; font-weight: normal;"&gt;  &lt;hr size="2" width="100%" align="center"&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What base class do all Web Forms inherit from? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt;System.Windows.Forms.Form&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What is the difference between Debug.Write and Trace.Write? When should each be used? &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;The Debug.Write call won't be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;Difference between Anchor and Dock Properties?&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt;Dock Property-&gt;Gets or sets which edge of the parent container a control is docked to. A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container. For example, if you set this property to DockStyle.Left, the left edge of the&lt;br /&gt;control will be docked to the left edge of its parent control. Additionally, the docked edge of  the control is resized to match that of its container&lt;br /&gt;control.&lt;br /&gt;Anchor Property-&gt;Gets or sets which edges of the control are anchored to the edges of its container.  A control can be anchored to one or more edges of its parent container. Anchoring a control to its parent ensures that the anchored edges remain in the same position relative to the edges of the parent container when the parent container is resized.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;When would you use ErrorProvider control?&lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt;ErrorProvider control is used in Windows Forms application. It is like Validation Control for ASP.NET pages. ErrorProvider control is used to provide validations in Windows forms and display user friendly messages to the user if the validation fails.&lt;br /&gt; E.g&lt;br /&gt; If we went to validate the textBox1 should be empty, then we can validate as below&lt;br /&gt; 1). You need to place the errorprovide control on the form&lt;br /&gt; private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)&lt;br /&gt;{&lt;br /&gt;ValidateName();&lt;br /&gt;}&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt;private bool ValidateName()&lt;br /&gt;{&lt;br /&gt;bool bStatus = true;&lt;br /&gt;if (textBox1.Text == "")&lt;br /&gt;{&lt;br /&gt;errorProvider1.SetError (textBox1,"Please enter your Name");&lt;br /&gt;bStatus = false;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;errorProvider1.SetError (textBox1,"");&lt;br /&gt;return bStatus;&lt;br /&gt;}&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt; it check the textBox1 is empty . If it is empty, then a message Please enter your name is displayed.&lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;Can you write a class without specifying namespace? Which namespace does it belong to by default??&lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you  wouldn't want global namespace. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;You are designing a GUI application with a windows and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place.&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: maroon;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What's the problem? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at  the same location when resized. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;How can you save the desired properties of Windows Forms application? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;.config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;So how do you retrieve the customized properties of a .NET application from XML .config file? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;Can you automate this process? &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;My progress bar freezes up and dialog window shows blank, when an intensive background process takes over. &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Yes, you should've multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What's the safest way to deploy a Windows Forms app?&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Web deployment: the user always downloads the latest version of the code, the program runs within security sandbox, properly written app will not require additional security privileges. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;The designer will likely through it away, most of the code inside InitializeComponent is auto-generated. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What's the difference between WindowsDefaultLocation and WindowsDefaultBounds?&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What's the difference between Move and LocationChanged? Resize and SizeChanged? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;How would you create a non-rectangular window, let's say an ellipse? &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;How do you create a separator in the Menu Designer? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;A hyphen '-' would do it. Also, an ampersand '&amp;amp;\' would underline the next letter. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;How's anchoring different from docking? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking  treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;How do you trigger the Paint event in System.Drawing?&lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Invalidate the current form, the OS will take care of repainting. The Update method forces the repaint. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;With these events, why wouldn't Microsoft combine Invalidate and Paint, so that you wouldn't have to tell it to repaint, and then to force it to repaint?&lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;How can you assign an RGB color to a System.Drawing.Color object?&lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Call the static method FromArgb of this class and pass it the RGB values. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;What class does Icon derive from? &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Isn't it just a Bitmap with a wrapper name around it? No, Icon lives in System.Drawing namespace. It's not a Bitmap by default, and is treated separately by .NET. However, you can use ToBitmap method to get a valid Bitmap object from a valid Icon object. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically? &lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;By using System.Drawing.SystemIcons class, for example System.Drawing.SystemIcons.Warning produces an Icon with a  warning sign in it. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;When displaying fonts, what's the difference between pixels, points and ems? &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Geneva&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on user's settings and monitor size. A point is always 1/72 of an inch. An em is the number of pixels that it takes to display the letter M. &lt;/span&gt;&lt;span style="font-family: &amp;quot;Tahoma&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9199272216035429677-1410179820195198378?l=winformfaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://winformfaqs.blogspot.com/feeds/1410179820195198378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9199272216035429677&amp;postID=1410179820195198378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default/1410179820195198378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default/1410179820195198378'/><link rel='alternate' type='text/html' href='http://winformfaqs.blogspot.com/2008/10/winforms-faqs.html' title='WinForms FAQs'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9199272216035429677.post-6586769462792931590</id><published>2008-07-25T10:50:00.000-07:00</published><updated>2008-12-22T21:17:15.756-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Winform'/><title type='text'>WinForms Questions:</title><content type='html'>What base class do all Web Forms inherit from?&lt;br /&gt;System.Windows.Forms.Form&lt;br /&gt;&lt;br /&gt;What is the difference between Debug.Write and Trace.Write? When should each be used?&lt;br /&gt;The Debug.Write call won't be compiled when the DEBUGsymbol is not defined (when doing a release build). Trace.Write calls will be compiled. Debug.Write is for information you want only in debug builds, Trace.Write is for when you want it in release build as well.&lt;br /&gt;&lt;br /&gt;Difference between Anchor and Dock Properties?&lt;br /&gt;Dock Property-&gt;Gets or sets which edge of the parent container a control is docked to. A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container. For example, if you set this property to DockStyle.Left, the left edge of the&lt;br /&gt;control will be docked to the left edge of its parent control. Additionally, the docked edge of  the control is resized to match that of its container&lt;br /&gt;control.&lt;br /&gt;Anchor Property-&gt;Gets or sets which edges of the control are anchored to the edges of its container.  A control can be anchored to one or more edges of its parent container. Anchoring a control to its parent ensures that the anchored edges remain in the same position relative to the edges of the parent container when the parent container is resized.&lt;br /&gt;&lt;br /&gt;When would you use ErrorProvider control?&lt;br /&gt;ErrorProvider control is used in Windows Forms application. It is like Validation Control for ASP.NET pages. ErrorProvider control is used to provide validations in Windows forms and display user friendly messages to the user if the validation fails.&lt;br /&gt; E.g&lt;br /&gt; If we went to validate the textBox1 should be empty, then we can validate as below&lt;br /&gt; 1). You need to place the errorprovide control on the form&lt;br /&gt; private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)&lt;br /&gt;{&lt;br /&gt;ValidateName();&lt;br /&gt;}&lt;br /&gt;private bool ValidateName()&lt;br /&gt;{&lt;br /&gt;bool bStatus = true;&lt;br /&gt;if (textBox1.Text == "")&lt;br /&gt;{&lt;br /&gt;errorProvider1.SetError (textBox1,"Please enter your Name");&lt;br /&gt;bStatus = false;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;errorProvider1.SetError (textBox1,"");&lt;br /&gt;return bStatus;&lt;br /&gt;}&lt;br /&gt; it check the textBox1 is empty . If it is empty, then a message Please enter your name is displayed.&lt;br /&gt;&lt;br /&gt;Can you write a class without specifying namespace? Which namespace does it belong to by default??&lt;br /&gt;Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you  wouldn't want global namespace.&lt;br /&gt;&lt;br /&gt;You are designing a GUI application with a windows and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What's the problem?&lt;br /&gt;One should use anchoring for correct resizing. Otherwise the default property of a widget on a form is top-left, so it stays at  the same location when resized.&lt;br /&gt;&lt;br /&gt;How can you save the desired properties of Windows Forms application?&lt;br /&gt;.config files in .NET are supported through the API to allow storing and retrieving information. They are nothing more than simple XML files, sort of like what .ini files were before for Win32 apps.&lt;br /&gt;&lt;br /&gt;So how do you retrieve the customized properties of a .NET application from XML .config file?&lt;br /&gt;Initialize an instance of AppSettingsReader class. Call the GetValue method of AppSettingsReader class, passing in the name of the property and the type expected. Assign the result to the appropriate variable.&lt;br /&gt;&lt;br /&gt;Can you automate this process?&lt;br /&gt;In Visual Studio yes, use Dynamic Properties for automatic .config creation, storage and retrieval.&lt;br /&gt;&lt;br /&gt;My progress bar freezes up and dialog window shows blank, when an intensive background process takes over.&lt;br /&gt;Yes, you should've multi-threaded your GUI, with taskbar and main form being one thread, and the background process being the other.&lt;br /&gt;&lt;br /&gt;What's the safest way to deploy a Windows Forms app?&lt;br /&gt;Web deployment: the user always downloads the latest version of the code, the program runs within security sandbox, properly written app will not require additional security privileges.&lt;br /&gt;&lt;br /&gt;Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio?&lt;br /&gt;The designer will likely through it away, most of the code inside InitializeComponent is auto-generated.&lt;br /&gt;&lt;br /&gt;What's the difference between WindowsDefaultLocation and WindowsDefaultBounds?&lt;br /&gt;WindowsDefaultLocation tells the form to start up at a location selected by OS, but with internally specified size. WindowsDefaultBounds delegates both size and starting position choices to the OS.&lt;br /&gt;&lt;br /&gt;What's the difference between Move and LocationChanged? Resize and SizeChanged?&lt;br /&gt;Both methods do the same, Move and Resize are the names adopted from VB to ease migration to C#.&lt;br /&gt;&lt;br /&gt;How would you create a non-rectangular window, let's say an ellipse?&lt;br /&gt;Create a rectangular form, set the TransparencyKey property to the same value as BackColor, which will effectively make the background of the form transparent. Then set the FormBorderStyle to FormBorderStyle.None, which will remove the contour and contents of the form.&lt;br /&gt;&lt;br /&gt;How do you create a separator in the Menu Designer?&lt;br /&gt;A hyphen '-' would do it. Also, an ampersand '&amp;amp;\' would underline the next letter.&lt;br /&gt;&lt;br /&gt;How's anchoring different from docking?&lt;br /&gt;Anchoring treats the component as having the absolute size and adjusts its location relative to the parent form. Docking  treats the component location as absolute and disregards the component size. So if a status bar must always be at the bottom no matter what, use docking. If a button should be on the top right, but change its position with the form being resized, use anchoring.&lt;br /&gt;&lt;br /&gt;How do you trigger the Paint event in System.Drawing?&lt;br /&gt;Invalidate the current form, the OS will take care of repainting. The Update method forces the repaint.&lt;br /&gt;&lt;br /&gt;With these events, why wouldn't Microsoft combine Invalidate and Paint, so that you wouldn't have to tell it to repaint, and then to force it to repaint?&lt;br /&gt;Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background.&lt;br /&gt;&lt;br /&gt;How can you assign an RGB color to a System.Drawing.Color object?&lt;br /&gt;Call the static method FromArgb of this class and pass it the RGB values.&lt;br /&gt;&lt;br /&gt;What class does Icon derive from?&lt;br /&gt;Isn't it just a Bitmap with a wrapper name around it? No, Icon lives in System.Drawing namespace. It's not a Bitmap by default, and is treated separately by .NET. However, you can use ToBitmap method to get a valid Bitmap object from a valid Icon object.&lt;br /&gt;&lt;br /&gt;Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically?&lt;br /&gt;By using System.Drawing.SystemIcons class, for example System.Drawing.SystemIcons.Warning produces an Icon with a  warning sign in it.&lt;br /&gt;&lt;br /&gt;When displaying fonts, what's the difference between pixels, points and ems?&lt;br /&gt;A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on user's settings and monitor size. A point is always 1/72 of an inch. An em is the number of pixels that it takes to display the letter M.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9199272216035429677-6586769462792931590?l=winformfaqs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://winformfaqs.blogspot.com/feeds/6586769462792931590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9199272216035429677&amp;postID=6586769462792931590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default/6586769462792931590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9199272216035429677/posts/default/6586769462792931590'/><link rel='alternate' type='text/html' href='http://winformfaqs.blogspot.com/2008/07/winforms-questions.html' title='WinForms Questions:'/><author><name>Siebel Expert</name><uri>http://www.blogger.com/profile/11533458660230230361</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9199272216035429677.post-805542745176927415</id><published>2008-07-21T04:29:00.000-07:00</published><updated>2008-12-22T21:17:15.757-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Winform'/><title type='text'>DataGridView Control FAQ's</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso"&gt;&lt;link rel="OLE-Object-Data" href="file:///D:%5CDOCUME%7E1%5Cshesu04%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_oledata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State"&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:documentproperties&gt;   &lt;o:author&gt;support&lt;/o:Author&gt;   &lt;o:version&gt;11.9999&lt;/o:Version&gt;  &lt;/o:DocumentProperties&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:ËÎÌå; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:Mangal; 	panose-1:0 0 4 0 0 0 0 0 0 0; 	mso-font-charset:0; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:32771 0 0 0 1 0;} @font-face 	{font-family:Sylfaen; 	panose-1:1 10 5 2 5 3 6 3 3 3; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:67110535 0 0 0 159 0;} @font-face 	{font-family:Tahoma; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-alt:Tahoma; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:1627421319 -2147483648 8 0 66047 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:"\@Arial Unicode MS"; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Sylfaen; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h1 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0in; 	margin-bottom:3.0pt; 	margin-left:0in; 	text-indent:-.6in; 	page-break-before:always; 	mso-pagination:widow-orphan; 	mso-outline-level:1; 	mso-list:l24 level1 lfo12; 	tab-stops:list 0in; 	font-size:16.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-font-kerning:16.0pt; 	mso-fareast-language:EN-US;} h2 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0in; 	margin-bottom:3.0pt; 	margin-left:0in; 	text-indent:-.5in; 	mso-pagination:widow-orphan; 	mso-outline-level:2; 	mso-list:l24 level2 lfo12; 	tab-stops:list 0in; 	font-size:14.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US; 	mso-bidi-font-style:italic;} h3 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0in; 	margin-bottom:3.0pt; 	margin-left:0in; 	text-indent:0in; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:3; 	mso-list:l24 level3 lfo12; 	tab-stops:list 0in; 	font-size:13.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h4 	{mso-style-parent:"Heading 3"; 	mso-style-next:Normal; 	margin-top:3.0pt; 	margin-right:0in; 	margin-bottom:3.0pt; 	margin-left:16.2pt; 	text-indent:-.6in; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:4; 	mso-list:l24 level4 lfo12; 	tab-stops:list 16.2pt; 	font-size:10.0pt; 	mso-bidi-font-size:13.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoToc1, li.MsoToc1, div.MsoToc1 	{mso-style-update:auto; 	mso-style-noshow:yes; 	mso-style-next:Normal; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:22.0pt right dotted 454.5pt; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Sylfaen; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoToc2, li.MsoToc2, div.MsoToc2 	{mso-style-update:auto; 	mso-style-noshow:yes; 	mso-style-next:Normal; 	margin-top:0in; 	margin-right:-63.0pt; 	margin-bottom:0in; 	margin-left:11.0pt; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:.5in right dotted 454.5pt; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Sylfaen; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoToc3, li.MsoToc3, div.MsoToc3 	{mso-style-update:auto; 	mso-style-noshow:yes; 	mso-style-next:Normal; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:22.0pt; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:60.0pt right dotted 454.5pt; 	font-size:10.0pt; 	font-family:Sylfaen; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:Sylfaen; 	mso-fareast-language:EN-US; 	mso-no-proof:yes;} p.MsoHeader, li.MsoHeader, div.MsoHeader 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:center 3.0in right 6.0in; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Sylfaen; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoFooter, li.MsoFooter, div.MsoFooter 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:center 3.0in right 6.0in; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Sylfaen; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} a:link, span.MsoHyperlink 	{mso-ansi-font-size:10.0pt; 	font-family:Sylfaen; 	mso-ascii-font-family:Sylfaen; 	mso-hansi-font-family:Sylfaen; 	color:blue; 	position:relative; 	top:0pt; 	mso-text-raise:0pt; 	letter-spacing:0pt; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:purple; 	text-decoration:underline; 	text-underline:single;} p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap 	{mso-style-noshow:yes; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	background:navy; 	font-size:10.0pt; 	font-family:Tahoma; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.BulletList, li.BulletList, div.BulletList 	{mso-style-name:"Bullet List"; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:.5in; 	margin-bottom:.0001pt; 	text-indent:-.25in; 	mso-pagination:widow-orphan; 	mso-list:l37 level1 lfo10; 	tab-stops:list .5in; 	font-size:10.0pt; 	mso-bidi-font-size:11.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} span.TOCHidden 	{mso-style-name:"TOC Hidden"; 	mso-style-parent:""; 	mso-ansi-font-size:24.0pt; 	mso-bidi-font-size:24.0pt; 	text-shadow:auto; 	font-weight:bold; 	mso-bidi-font-weight:normal;} p.Code, li.Code, div.Code 	{mso-style-name:Code; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	mso-layout-grid-align:none; 	text-autospace:none; 	font-size:9.0pt; 	mso-bidi-font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-language:EN-US; 	mso-no-proof:yes;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:74283306; 	mso-list-type:hybrid; 	mso-list-template-ids:186423778 67698693 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} @list l1 	{mso-list-id:140005413; 	mso-list-type:hybrid; 	mso-list-template-ids:-773689292 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l1:level1 	{mso-level-tab-stop:.25in; 	mso-level-number-position:left; 	margin-left:.25in; 	text-indent:-.25in;} @list l1:level2 	{mso-level-number-format:alpha-lower; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l2 	{mso-list-id:179779013; 	mso-list-type:hybrid; 	mso-list-template-ids:7880122 67698693 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l2:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} @list l3 	{mso-list-id:190270775; 	mso-list-type:hybrid; 	mso-list-template-ids:327960370 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l3:level1 	{mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l4 	{mso-list-id:257182116; 	mso-list-type:hybrid; 	mso-list-template-ids:-613108884 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l4:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l5 	{mso-list-id:299696985; 	mso-list-type:hybrid; 	mso-list-template-ids:33322038 67698705 67698693 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l5:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l5:level2 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} @list l6 	{mso-list-id:418062303; 	mso-list-type:hybrid; 	mso-list-template-ids:-1025087752 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l6:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l7 	{mso-list-id:469903947; 	mso-list-type:hybrid; 	mso-list-template-ids:-274458772 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l7:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l7:level2 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:"Courier New";} @list l8 	{mso-list-id:500899791; 	mso-list-type:hybrid; 	mso-list-template-ids:-20299384 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l8:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l9 	{mso-list-id:503710634; 	mso-list-type:hybrid; 	mso-list-template-ids:1921914530 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l9:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l10 	{mso-list-id:593977765; 	mso-list-type:hybrid; 	mso-list-template-ids:-2096362440 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l10:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l11 	{mso-list-id:639655381; 	mso-list-type:hybrid; 	mso-list-template-ids:-429343496 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l11:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l12 	{mso-list-id:649822161; 	mso-list-type:hybrid; 	mso-list-template-ids:-2120827948 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l12:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l13 	{mso-list-id:733892453; 	mso-list-type:hybrid; 	mso-list-template-ids:871508628 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l13:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l14 	{mso-list-id:792944951; 	mso-list-type:hybrid; 	mso-list-template-ids:-2092678458 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l14:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l15 	{mso-list-id:962423796; 	mso-list-type:hybrid; 	mso-list-template-ids:1515347686 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l15:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l16 	{mso-list-id:1007831142; 	mso-list-type:hybrid; 	mso-list-template-ids:-1273227532 793956556 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l16:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:1.25in; 	mso-level-number-position:left; 	margin-left:1.25in; 	text-indent:-.25in;} @list l17 	{mso-list-id:1052774911; 	mso-list-type:hybrid; 	mso-list-template-ids:645021814 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l17:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l18 	{mso-list-id:1160577919; 	mso-list-type:hybrid; 	mso-list-template-ids:2041489636 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l18:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l19 	{mso-list-id:1164784906; 	mso-list-type:hybrid; 	mso-list-template-ids:-10347454 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l19:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l20 	{mso-list-id:1284768916; 	mso-list-type:hybrid; 	mso-list-template-ids:-317317532 67698693 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l20:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} @list l21 	{mso-list-id:1357072634; 	mso-list-type:hybrid; 	mso-list-template-ids:-1345156072 67698693 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l21:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} @list l22 	{mso-list-id:1376930754; 	mso-list-type:hybrid; 	mso-list-template-ids:1376523380 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l22:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l23 	{mso-list-id:1401365264; 	mso-list-type:hybrid; 	mso-list-template-ids:-1569785548 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l23:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l24 	{mso-list-id:1466317991; 	mso-list-template-ids:626681316;} @list l24:level1 	{mso-level-style-link:"Heading 1"; 	mso-level-text:%1; 	mso-level-tab-stop:0in; 	mso-level-number-position:left; 	margin-left:0in; 	text-indent:-.6in; 	font-family:Mangal; 	mso-bidi-font-family:"Times New Roman";} @list l24:level2 	{mso-level-style-link:"Heading 2"; 	mso-level-text:"%1\.%2"; 	mso-level-tab-stop:0in; 	mso-level-number-position:left; 	margin-left:0in; 	text-indent:-.5in; 	font-variant:normal !important; 	mso-hide:none; 	text-transform:none; 	position:relative; 	top:0pt; 	mso-text-raise:0pt; 	letter-spacing:0pt; 	text-effect:none; 	text-shadow:none; 	text-effect:none; 	text-effect:none; 	font-emphasize:none; 	mso-ansi-font-style:normal; 	mso-bidi-font-style:normal; 	text-decoration:none; 	text-underline:none; 	text-decoration:none; 	text-line-through:none; 	vertical-align:baseline;} @list l24:level3 	{mso-level-style-link:"Heading 3"; 	mso-level-text:"%1\.%2\.%3"; 	mso-level-tab-stop:0in; 	mso-level-number-position:left; 	margin-left:0in; 	text-indent:0in;} @list l24:level4 	{mso-level-style-link:"Heading 4"; 	mso-level-text:"%1\.%2\.%3\.%4"; 	mso-level-tab-stop:16.2pt; 	mso-level-number-position:left; 	margin-left:16.2pt; 	text-indent:-.6in;} @list l24:level5 	{mso-level-text:"%1\.%2\.%3\.%4\.%5"; 	mso-level-tab-stop:23.4pt; 	mso-level-number-position:left; 	margin-left:23.4pt; 	text-indent:-.7in;} @list l24:level6 	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6"; 	mso-level-tab-stop:30.6pt; 	mso-level-number-position:left; 	margin-left:30.6pt; 	text-indent:-.8in;} @list l24:level7 	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7"; 	mso-level-tab-stop:37.8pt; 	mso-level-number-position:left; 	margin-left:37.8pt; 	text-indent:-.9in;} @list l24:level8 	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8"; 	mso-level-tab-stop:45.0pt; 	mso-level-number-position:left; 	margin-left:45.0pt; 	text-indent:-1.0in;} @list l24:level9 	{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9"; 	mso-level-tab-stop:52.2pt; 	mso-level-number-position:left; 	margin-left:52.2pt; 	text-indent:-1.1in;} @list l25 	{mso-list-id:1712338562; 	mso-list-type:hybrid; 	mso-list-template-ids:-1957393608 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l25:level1 	{mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l26 	{mso-list-id:1773551314; 	mso-list-type:hybrid; 	mso-list-template-ids:1998853746 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l26:level1 	{mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l27 	{mso-list-id:1817794398; 	mso-list-type:hybrid; 	mso-list-template-ids:-1554072202 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l27:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l28 	{mso-list-id:1824003660; 	mso-list-type:hybrid; 	mso-list-template-ids:1104307644 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l28:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l29 	{mso-list-id:1872184083; 	mso-list-type:hybrid; 	mso-list-template-ids:-439971448 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l29:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l30 	{mso-list-id:1887448486; 	mso-list-type:hybrid; 	mso-list-template-ids:-982058096 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l30:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l31 	{mso-list-id:1901667682; 	mso-list-type:hybrid; 	mso-list-template-ids:-1503489780 67698693 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l31:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} @list l32 	{mso-list-id:1919943747; 	mso-list-type:hybrid; 	mso-list-template-ids:2131368036 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l32:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l33 	{mso-list-id:1942297030; 	mso-list-type:hybrid; 	mso-list-template-ids:1988818416 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l33:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l34 	{mso-list-id:2001888921; 	mso-list-type:hybrid; 	mso-list-template-ids:-1421942572 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l34:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l35 	{mso-list-id:2088916434; 	mso-list-type:hybrid; 	mso-list-template-ids:735605842 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l35:level1 	{mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l36 	{mso-list-id:2117434614; 	mso-list-type:hybrid; 	mso-list-template-ids:2100599994 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l36:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l37 	{mso-list-id:2121298717; 	mso-list-type:hybrid; 	mso-list-template-ids:536788202 336515626 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l37:level1 	{mso-level-number-format:bullet; 	mso-level-style-link:"Bullet List"; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l37:level2 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:"Courier New";} @list l38 	{mso-list-id:2121755737; 	mso-list-type:hybrid; 	mso-list-template-ids:-1516889904 67698689 67698693 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l38:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l38:level2 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Wingdings;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} table.MsoTableGrid 	{mso-style-name:"Table Grid"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	border:solid windowtext 1.0pt; 	mso-border-alt:solid windowtext .5pt; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-border-insideh:.5pt solid windowtext; 	mso-border-insidev:.5pt solid windowtext; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;h1 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903409"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Mangal;"&gt;&lt;span style=""&gt;1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;What is the DataGridView&lt;/a&gt;&lt;/h1&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With the DataGridView control, you can display and edit tabular data from many different kinds of data sources. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control is highly configurable and extensible, and it provides many properties, methods, and events to customize its appearance and behavior. When you want your Windows Forms application to display tabular data, consider using the DataGridView control before others (for example, DataGrid). If you are displaying a small grid of read-only values, or if you are enabling a user to edit a table with millions of records, the DataGridView control will provide you with a readily programmable, memory-efficient solution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control replaces and adds functionality to the DataGrid control; however, the DataGrid control is retained for both backward compatibility and future use, if you choose. See below for details on the differences between the DataGrid and DataGridView controls.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903410"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Differences between the DataGridView and DataGrid controls&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control provides numerous basic and advanced features that are missing in the DataGrid control. Additionally, the architecture of the DataGridView control makes it much easier to extend and customize than the DataGrid control. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;The following table describes a few of the primary features available in the DataGridView control that are missing from the DataGrid control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 154.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView control feature &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 313.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   column types&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control provides more   built-in column types than the &lt;span style=""&gt;DataGrid&lt;/span&gt;   control. These column types meet the needs of most common scenarios, but are   also easier to extend or replace than the column types in the &lt;span style=""&gt;DataGrid&lt;/span&gt; control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   ways to display data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGrid&lt;/span&gt; control is limited to   displaying data from an external data source. The &lt;span style=""&gt;DataGridView&lt;/span&gt; control, however, can display unbound data stored   in the control, data from a bound data source, or bound and unbound data   together. You can also implement virtual mode in the &lt;span style=""&gt;DataGridView&lt;/span&gt; control to provide custom data management.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   ways to customize the display of data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control provides many   properties and events that enable you to specify how data is formatted and   displayed. For example, you can change the appearance of cells, rows, and   columns depending on the data they contain, or you can replace data of one   data type with equivalent data of another type. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   options for changing cell, row, column, and header appearance and behavior&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control enables you to   work with individual grid components in numerous ways. For example, you can   freeze rows and columns to prevent them from scrolling; hide rows, columns,   and headers; change the way row, column, and header sizes are adjusted;   change the way users make selections; and provide ToolTips and shortcut menus   for individual cells, rows, and columns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The only feature that is available in the DataGrid control that is not available in the DataGridView control is the hierarchical display of information from two related tables in a single control. You must use two DataGridView controls to display information from two tables that are in a master/detail relationship.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903411"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Highlight of features&lt;/a&gt; &lt;/h2&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;The following table highlights the DataGridView’s major features. Further details about a feature can be found later in this document&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 154.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView control feature &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 313.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   column types&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control provides TextBox,   CheckBox, Image, Button, ComboBox and Link columns with the corresponding   cell types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   ways to display data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control can display   unbound data stored in the control, data from a bound data source, or bound   and unbound data together. You can also implement virtual mode in the &lt;span style=""&gt;DataGridView&lt;/span&gt; control to provide   custom data management.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   ways to customize the display and work with data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control provides many   properties and events that enable you to specify how data is formatted and   displayed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;In addition,   the DataGridView control provides multiple ways to work with your data. For   example, you can:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;sort data with corresponding sort glyph&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;enable selection modes by row, column or cell;   multi-selection or single selection&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;copy content to the clipboard in multiple formats   including text, CSV (comma separated value) &amp;amp; HTML&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;change the way users edit cell content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Multiple   options for changing cell, row, column, and header appearance and behavior&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The &lt;span style=""&gt;DataGridView&lt;/span&gt; control enables you to   work with individual grid components in numerous ways. For example, you can:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;freeze rows and columns to prevent them from   scrolling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;hide rows, columns, and headers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;change the way row, column, and header sizes are   adjusted based upon size&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;change the way users make selections&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;provide ToolTips and shortcut menus for individual   cells, rows, and columns&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;customize the border styles of cell, rows and   columns&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Rich   extensibility support&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The   DataGridView control provides the infrastructure to extend and customize the   grid. For example, you can:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;handle custom painting events to provide a custom   look and feel to the cells, columns and rows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;derive from one of the built-in cell types to   provide additional behavior&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;implement custom interfaces to create a brand new   editing experience&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h1 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903412"&gt;&lt;/a&gt;&lt;a name="_Toc116373070"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Mangal;"&gt;&lt;span style=""&gt;2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Structure of DGV&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control and its related classes are designed to be a flexible, extensible system for displaying and editing tabular data. These classes are all contained in the System.Windows.Forms namespace, and they are all named with the "DataGridView" prefix.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903413"&gt;&lt;/a&gt;&lt;a name="_Toc116373071"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Architecture Elements&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The primary DataGridView companion classes derive from DataGridViewElement. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;  &lt;v:stroke joinstyle="miter"&gt;  &lt;v:formulas&gt;   &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;   &lt;v:f eqn="sum @0 1 0"&gt;   &lt;v:f eqn="sum 0 0 @1"&gt;   &lt;v:f eqn="prod @2 1 2"&gt;   &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;   &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @0 0 1"&gt;   &lt;v:f eqn="prod @6 1 2"&gt;   &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;   &lt;v:f eqn="sum @8 21600 0"&gt;   &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;   &lt;v:f eqn="sum @10 21600 0"&gt;  &lt;/v:formulas&gt;  &lt;v:path extrusionok="f" gradientshapeok="t" connecttype="rect"&gt;  &lt;o:lock ext="edit" aspectratio="t"&gt; &lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style="'width:134.25pt;"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image001.emz" title="" croptop="-4779f"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image002.gif" shapes="_x0000_i1025" width="179" height="103" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;The DataGridViewElement class provides a reference to the parent DataGridView control and has a State property, which holds a value that represents a combination of values from the DataGridViewElementStates enumeration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903414"&gt;&lt;/a&gt;&lt;a name="_Toc116373072"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cells and Bands&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control comprises two fundamental kinds of objects: cells and bands. All cells derive from the DataGridViewCell base class. The two kinds of bands, DataGridViewColumn and DataGridViewRow, both derive from the DataGridViewBand base class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control interoperates with several classes, but the most commonly encountered are DataGridViewCell, DataGridViewColumn, and DataGridViewRow. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903415"&gt;&lt;/a&gt;&lt;a name="_Toc116373073"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewCell&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The cell is the fundamental unit of interaction for the DataGridView. Display is centered on cells, and data entry is often performed through cells. You can access cells by using the Cells collection of the DataGridViewRow class, and you can access the selected cells by using the SelectedCells collection of the DataGridView control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-size: 10pt; font-family: Sylfaen;"&gt;&lt;br /&gt; &lt;/span&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; width: 459.6pt; margin-left: 9.9pt; border-collapse: collapse;" width="613" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 3in;" valign="top" width="288"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;The   DataGridViewCell class diagram&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1026" type="#_x0000_t75" style="'width:204pt;height:197.25pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image003.emz" title="" croptop="26685f" cropright="8162f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image004.gif" shapes="_x0000_i1026" width="272" height="263" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 243.6pt;" valign="top" width="325"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Cell Related   Classes and Properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1027" type="#_x0000_t75" style="'width:232.5pt;height:134.25pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image003.emz" title="" croptop="-888f" cropbottom="39944f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image005.gif" shapes="_x0000_i1027" width="310" height="179" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewCell type is an abstract base class, from which all cell types derive. DataGridViewCell and its derived types are not Windoyws Forms controls, but some host Windows Forms controls. Any editing functionality supported by a cell is typically handled by a hosted control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;DataGridViewCell objects do not control their own appearance and painting features in the same way as Windows Forms controls. Instead, the DataGridView is responsible for the appearance of its DataGridViewCell objects. You can significantly affect the appearance and behavior of cells by interacting with the DataGridView control's properties and events. When you have special requirements for customizations that are beyond the capabilities of the DataGridView control, you can implement your own class that derives from DataGridViewCell or one of its child classes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903416"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.3.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;How a DataGridViewCell works&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;An important part of understanding the structure of the DataGridView is to understand how a DataGridViewCell works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;A Cell’s Value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;At the root of a cell is its value. For cells in a column that is not databound and the grid is not in virtual mode the cells actually store the value in the cell instance. For databound cells the cell doesn’t “know” or keep the value is at all. Anytime the cell’s value is needed the grid goes to the datasource and looks up the value for the column and row and returns that as the cell’s value. In virtual mode this routine is very similar except the grid raises the CellValueNeeded event to get the cell’s value. At the cell level, all of this is controlled via the DataGridViewCell::GetValue(...) method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;The data type for the cell’s Value property by default is of type object. When a column becomes databound its ValueType property is set which causes each cell’s ValueType to be updated. The value of the ValueType property is important for formatting. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;Formatting for Display&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;Anytime the grid needs to know “how would this cell display” it needs to get its &lt;i style=""&gt;FormattedValue&lt;/i&gt;. This is a complex routine because formatting something on the screen usually needs to be converted to a string. For example, although you set a cell’s value to the integer value of 155 when 155 needs to be displayed it has to become formatted for the display. The cells and column’s FormattedValueType property determines the type that is used for display. Most columns use string, but the image and check box cells\columns have different values. The DataGridViewImageCell and column use Image as the default FormattedValueType since its painting code knows how to display an image. A checkbox cell\column’s FormattedValueType varies depending upon the value of ThreeState. At the cell level, all of this is controlled via the DataGridViewCell::GetFormattedValue(...) method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;By default, the DataGridView uses TypeConverters to convert a cell’s value to its formatted value. Retrieving the proper TypeConverter is based upon the cell’s ValueType and FormattedValueType properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;For a cell, the FormattedValue is requested many times. Anytime the cell is painted or when a column needs to be autosized based upon the cell’s content; the FormattedValue is even needed when determining if the mouse is over the cell content or not. Anytime the FormattedValue is required the DataGridView raises the CellFormatting event. This provides you with the opportunity to modify how the cell is formatted.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;If a cell cannot retrieve its formatted value correctly it raises the DataError event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;Part of formatting a cell for display is understanding what the preferred size of the cell is. The preferred size is a combination of the cell’s FormattedValue, any padding or additional display and the borders. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;Painting the Display&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;After the FormattedValue is retrieved the cell’s responsible for painting the cell’s content. The cell determines the correct style to paint with (see the Styling section later in this document) and paints the cell. It is important to note that if a cell does not paint itself then nothing is painted. A row or column performs no painting, so ensure that at least a background is painted in the cell otherwise the rectangle remains invalidated (unpainted).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;Parsing the Display&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;After the user interacts with a cell at some point the user will edit a cell’s value. One important thing to note is that the user in reality is editing the cell’s FormattedValue. When committing the value the FormattedValue has to be converted back to the cell’s value. This is called &lt;i style=""&gt;parsing&lt;/i&gt;. At the cell level, all of this is controlled via the DataGridViewCell::&lt;/span&gt; &lt;span style=""&gt;ParseFormattedValue (int rowIndex) method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;By default, TypeConverters are used again to parse the formatted value to the real value. The DataGridView raises the CellParsing event at this time to provide you with the opportunity to modify how the cell’s formatted value is parsed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 6pt 0.5in;"&gt;&lt;span style=""&gt;If a cell cannot correctly parse the formatted value it raises the DataError event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_prevent%20a%20particular%20cell%20"&gt;&lt;span style="font-family: Arial;"&gt;How do I prevent a particular cell from being editable?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_disable%20a%20cell?"&gt;&lt;span style="font-family: Arial;"&gt;How do I disable a cell?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_restrict%20user%20from%20setting"&gt;&lt;span style="font-family: Arial;"&gt;How do I restrict user from setting focus to a specific cell?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_show%20controls%20in%20all%20cells"&gt;&lt;span style="font-family: Arial;"&gt;How do I show controls in all cells regardless of edit?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_Why_does_the_cell%20text%20show%20up%20with"&gt;&lt;span style="font-family: Arial;"&gt;Why does the cell text show up with “square” characters where they should be new lines?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;6)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_show%20icon%20and%20text%20in%20the%20"&gt;&lt;span style="font-family: Arial;"&gt;How do I show icon and text in the same cell?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903417"&gt;&lt;/a&gt;&lt;a name="_Toc116373074"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;The schema of the DataGridView control's attached data store is expressed in the DataGridView control's columns. You can access the DataGridView control's columns by using the Columns collection. You can access the selected columns by using the SelectedColumns collection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; width: 6.5in; margin-left: 9.9pt; border-collapse: collapse;" width="624" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 206.35pt;" valign="top" width="275"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt; page-break-after: avoid;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;The   DataGridViewColumn class diagram&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt; page-break-after: avoid;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1028" type="#_x0000_t75" style="'width:195.75pt;height:136.5pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image006.emz" title="" croptop="32774f" cropright="14042f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image007.gif" shapes="_x0000_i1028" width="261" border="0" height="182" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 261.65pt;" valign="top" width="349"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt; page-break-after: avoid;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Column   Related Classes and Properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt; page-break-after: avoid;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1029" type="#_x0000_t75" style="'width:249pt;height:136.5pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image006.emz" title="" croptop="-721f" cropbottom="33446f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image008.gif" shapes="_x0000_i1029" width="332" border="0" height="182" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;Some of the key cell types have corresponding column types. These are derived from the DataGridViewColumn base class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_hide%20a%20column?"&gt;&lt;span style="font-family: Arial;"&gt;How do I hide a column?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_prevent%20the%20user%20from%20sort"&gt;&lt;span style="font-family: Arial;"&gt;How do I prevent the user from sorting on a column?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_sort%20on%20multiple%20columns?"&gt;&lt;span style="font-family: Arial;"&gt;How do I sort on multiple columns?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903418"&gt;&lt;/a&gt;&lt;a name="_Toc116373075"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridView Editing Controls&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;Cells that support advanced editing functionality typically use a hosted control that is derived from a Windows Forms control. These controls also implement the IDataGridViewEditingControl interface. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; width: 6.55in; margin-left: 9.9pt; border-collapse: collapse;" width="629" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 235.8pt;" valign="top" width="314"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;The   DataGridView Editing Control Class diagram&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1030" type="#_x0000_t75" style="'width:225pt;height:79.5pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image009.emz" title="" croptop="-1606f" cropbottom="33089f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image010.gif" shapes="_x0000_i1030" width="300" border="0" height="106" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 235.8pt;" valign="top" width="314"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Classes that   implement Editing Controls &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1031" type="#_x0000_t75" style="'width:225pt;height:73.5pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image009.emz" title="" croptop="34053f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image011.gif" shapes="_x0000_i1031" width="300" border="0" height="98" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;The following editing controls are provided with the DataGridView control: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table illustrates the relationship among cell types, column types, and editing controls.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 134.1pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell type &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 180.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Hosted control &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 152.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Column type &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 134.1pt;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewButtonCell&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 180.9pt;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;n/a&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 152.9pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewButtonColumn&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 134.1pt;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCheckBoxCell&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 180.9pt;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;n/a&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 152.9pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCheckBoxColumn&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 134.1pt;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewComboBoxCell&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 180.9pt;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewComboBoxEditingControl&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 152.9pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewComboBoxColumn&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 134.1pt;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewImageCell&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 180.9pt;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;n/a&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 152.9pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewImageColumn&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 134.1pt;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewLinkCell&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 180.9pt;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;n/a&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 152.9pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewLinkColumn&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 134.1pt;" width="179"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewTextBoxCell&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 180.9pt;" width="241"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewTextBoxEditingControl&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 152.9pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewTextBoxColumn&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;a name="_Toc116373076"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_hook%20up%20events%20on%20the%20edit"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I hook up events on the editing control?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_When_should_I_remove%20event%20handlers"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;When should I remove event handlers from the editing control?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_handle%20the%20SelectedIndexCh"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I handle the SelectedIndexChanged event?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_show%20controls%20in%20all%20cells"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I show controls in all cells regardless of edit?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903419"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.6&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewRow&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;The DataGridViewRow class displays a record's data fields from the data store to which the DataGridView control is attached. You can access the DataGridView control's rows by using the Rows collection. You can access the selected rows by using the SelectedRows collection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;The DataGridViewColumn   class diagram&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1032" type="#_x0000_t75" style="'width:135.75pt;height:48pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image012.emz" title="" croptop="48346f" cropright="26898f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image013.gif" shapes="_x0000_i1032" width="181" border="0" height="64" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid none none; border-color: rgb(153, 153, 153) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 0in 5.4pt; width: 221.4pt;" valign="top" width="295"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Row Related   Classes and Properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1033" type="#_x0000_t75" style="'width:230.25pt;height:136.5pt'"&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image012.emz" title="" croptop="-1880f" cropbottom="18533f"&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image014.gif" shapes="_x0000_i1033" width="307" border="0" height="182" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can derive your own types from the DataGridViewRow class, although this will typically not be necessary. The DataGridView control has several row-related events and properties for customizing the behavior of its DataGridViewRow objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If you enable the DataGridView control's AllowUserToAddRows property, a special row for adding new rows appears as the last row. This row is part of the Rows collection, but it has special functionality that may require your attention. For more information, see Using the Row for New Records in the Windows Forms DataGridView Control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_perform%20drag%20and%20drop%20reor"&gt;&lt;span style="font-family: Arial;"&gt;How do I perform drag and drop reorder of rows?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h1 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903420"&gt;&lt;/a&gt;&lt;a name="_Toc116373077"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Mangal;"&gt;&lt;span style=""&gt;3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Out of the box column/cell types&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control uses several column types to display its information and enable users to modify or add information. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When you bind a DataGridView control and set the AutoGenerateColumns property to true, columns are automatically generated using default column types appropriate for the data types contained in the bound data source. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can also create instances of any of the column classes yourself and add them to the collection returned by the Columns property. You can create these instances for use as unbound columns, or you can manually bind them. Manually bound columns are useful, for example, when you want to replace an automatically generated column of one type with a column of another type. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table describes the various column classes available for use in the DataGridView control:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 153pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Class &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 324.95pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewTextBoxColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used with   text-based values. Generated automatically when binding to numbers and   strings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCheckBoxColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used with   Boolean and CheckState values. Generated automatically when binding to values   of these types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewImageColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used to   display images. Generated automatically when binding to byte arrays, Image   objects, or Icon objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewButtonColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used to   display buttons in cells. Not automatically generated when binding. Typically   used as unbound columns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewComboBoxColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used to   display drop-down lists in cells. Not automatically generated when binding.   Typically data-bound manually.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewLinkColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used to   display links in cells. Not automatically generated when binding. Typically   data-bound manually.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Your   custom column type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 324.95pt;" width="433"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;You can   create your own column class by inheriting the DataGridViewColumn class or   any of its derived classes to provide custom appearance, behavior, or hosted   controls. &lt;/span&gt;&lt;i style=""&gt;&lt;u&gt;For more   information, see &lt;a href="http://www.windowsforms.net/Samples/Application%20Data/Microsoft/Word/9b7dc7b6-5ce6-4566-9949-902f74f17a81.htm"&gt;&lt;span style="color: windowtext;"&gt;How to: Customize Cells and Columns in the Windows   Forms DataGridView Control by Extending Their Behavior and Appearance&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/i&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_hide%20a%20column?"&gt;&lt;span style="font-family: Arial;"&gt;How do I hide a column?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_prevent%20a%20particular%20cell%20"&gt;&lt;span style="font-family: Arial;"&gt;How do I prevent a particular cell from being editable?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_restrict%20user%20from%20setting"&gt;&lt;span style="font-family: Arial;"&gt;How do I restrict user from setting focus to a specific cell?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_make%20the%20last%20column%20wide%20"&gt;&lt;span style=""&gt;How do I make the last column wide enough to occupy all the remaining client area of the grid?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in; page-break-after: avoid;"&gt;&lt;a name="_Toc119903421"&gt;&lt;/a&gt;&lt;a name="_Toc116373078"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewTextBoxColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewTextBoxColumn is a general-purpose column type for use with text-based values such as numbers and strings. In editing mode, a TextBox control is displayed in the active cell, enabling users to modify the cell value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Cell values are automatically converted to strings for display. Values entered or modified by the user are automatically parsed to create a cell value of the appropriate data type. You can customize these conversions by handling the CellFormatting and CellParsing events of the DataGridView control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The cell value data type of a column is specified in the ValueType property of the column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_have%20the%20cell%20text%20wrap?"&gt;&lt;span style=""&gt;How do I have the cell text wrap?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_Why_does_the_cell%20text%20show%20up%20with"&gt;&lt;span style="font-family: Arial;"&gt;Why does the cell text show up with “square” characters where they should be new lines?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_show%20icon%20and%20text%20in%20the%20"&gt;&lt;span style="font-family: Arial;"&gt;How do I show icon and text in the same cell?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;a href="#_How_do_I_restrict%20user%20from%20setting"&gt;&lt;span style="font-family: Arial;"&gt;How do I restrict user from setting focus to a specific cell?&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903422"&gt;&lt;/a&gt;&lt;a name="_Toc116373079"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewCheckBoxColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewCheckBoxColumn is used with Boolean and CheckState values. Boolean values display as two-state or three-state check boxes, depending on the value of the ThreeState property. When the column is bound to CheckState values, the ThreeState property value is true by default.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Typically, check box cell values are intended either for storage, like any other data, or for performing bulk operations. If you want to respond immediately when users click a check box cell, you can handle the CellClick event, but this event occurs before the cell value is updated. If you need the new value at the time of the click, one option is to calculate what the expected value will be based on the current value. Another approach is to commit the change immediately, and handle the CellValueChanged event to respond to it. To commit the change when the cell is clicked, you must handle the CurrentCellDirtyStateChanged event. In the handler, if the current cell is a check box cell, call the CommitEdit method and pass in the Commit value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903423"&gt;&lt;/a&gt;&lt;a name="_Toc116373080"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewImageColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewImageColumn is used to display images. Image columns can be populated automatically from a data source, populated manually for unbound columns, or populated dynamically in a handler for the CellFormatting event. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The automatic population of an image column from a data source works with byte arrays in a variety of image formats, including all formats supported by the Image class and the OLE Picture format used by Microsoft® Access and the Northwind sample database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Populating an image column manually is useful when you want to provide the functionality of a DataGridViewButtonColumn, but with a customized appearance. You can handle the CellClick event to respond to clicks within an image cell.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Populating the cells of an image column in a handler for the CellFormatting event is useful when you want to provide images for calculated values or values in non-image formats. For example, you may have a "Risk" column with string values such as "high", "middle", and "low" that you want to display as icons. Alternately, you may have an "Image" column that contains the locations of images that must be loaded rather than the binary content of the images.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_make%20the%20image%20column%20not%20"&gt;&lt;span style=""&gt;How do I make the image column not show any images?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903424"&gt;&lt;/a&gt;&lt;a name="_Toc116373081"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewButtonColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With the DataGridViewButtonColumn, you can display a column of cells that contain buttons. This is useful when you want to provide an easy way for your users to perform actions on particular records, such as placing an order or displaying child records in a separate window. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Button columns are not generated automatically when data-binding a DataGridView control. To use button columns, you must create them manually and add them to the collection returned by the Columns property.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can respond to user clicks in button cells by handling the CellClick event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903425"&gt;&lt;/a&gt;&lt;a name="_Toc116373082"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewComboBoxColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With the DataGridViewComboBoxColumn, you can display a column of cells that contain drop-down list boxes. This is useful for data entry in fields that can only contain particular values, such as the Category column of the Products table in the Northwind sample database. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can populate the drop-down list used for all cells the same way you would populate a ComboBox drop-down list, either manually through the collection returned by the Items property, or by binding it to a data source through the DataSource, DisplayMember, and ValueMember properties. For more information, see ComboBox Control (Windows Forms). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can bind the actual cell values to the data source used by the DataGridView control by setting the DataPropertyName property of the DataGridViewComboBoxColumn. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Combo box columns are not generated automatically when data-binding a DataGridView control. To use combo box columns, you must create them manually and add them to the collection returned by the Columns property. Alternatively you can use the designer and change a column type to a combo box column and set properties accordingly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903426"&gt;&lt;/a&gt;&lt;a name="_DataErrors_and_the_combo box column"&gt;&lt;/a&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.5.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;DataErrors and the combo box column&lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Sometimes when working the DataGridViewComboBoxColumn and modifying either the cell’s value or the combo box items collection, &lt;span style=""&gt; &lt;/span&gt;sometimes the DataError event might be raised. This is by design because of the data validation that the combo box cell performs. When the combo box cell attempts to draw its content it has to go from the cell value to the formatted value. This conversion requires looking up the value in the combo box items and getting the display value for the item. During this process, if the cell’s value cannot be found in the combo box items collection it raises the DataError event. Ignoring the DataError event might keep the cell from displaying the correct formatted value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in; page-break-after: avoid;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_enable%20typing%20in%20the%20combo"&gt;&lt;span style=""&gt;How do I enable typing in the combo box cell?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_handle%20the%20SelectedIndexCh"&gt;&lt;span style=""&gt;How do I handle the SelectedIndexChanged event?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_have%20a%20combo%20box%20column%20di"&gt;&lt;span style=""&gt;How do I have a combo box column display a sub set of data based upon the value of a different combo box column?&lt;/span&gt;&lt;/a&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903427"&gt;&lt;/a&gt;&lt;a name="_Toc116373083"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.6&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataGridViewLinkColumn&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With the DataGridViewLinkColumn, you can display a column of cells that contain hyperlinks. This is useful for URL values in the data source or as an alternative to the button column for special behaviors such as opening a window with child records. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Link columns are not generated automatically when data-binding a DataGridView control. To use link columns, you must create them manually and add them to the collection returned by the Columns property.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can respond to user clicks on links by handling the CellContentClick event. This event is distinct from the CellClick and CellMouseClick events, which occur when a user clicks anywhere in a cell. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewLinkColumn class provides several properties for modifying the appearance of links before, during, and after they are clicked.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h1 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903428"&gt;&lt;/a&gt;&lt;a name="_Toc116373084"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Mangal;"&gt;&lt;span style=""&gt;4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Working with Data&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;In most cases you’ll be using the DataGridView with data. There are many tasks that you might need to do when working with your data in the DataGridView. You might need to validate data that the user entered or maybe you might need to format the data. The DataGridView can display data in three distinct modes: bound, unbound, and virtual. Each mode has its own features and reasons to choose it over the other. Regardless of databound mode it is common for the grid to raise the DataError event when something goes wrong when working with data. Understanding why this event occurs will make the event more helpful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903429"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Data Entry and Validation Events&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When the user enters data – either at the row or cell level you might want to validate the data and maybe inform the user about invalid data. Like normal Windows Forms, there are Validating and Validated events at the cell and row level. Validating events can be canceled. There are also Enter and Leave events for when the user moves between cells or rows. Lastly there are events for when the user starts editing a cell. Understand the order of all these events will be helpful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903430"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Order of Validation Events&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;The following identifies the order of validation, enter/leave and begin/end edit events. The EditMode is EditOnEnter.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;When moving from cell to cell (in the same row)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell Leave (old cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell Validating/ed (old cell) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell EndEdit (old cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell Enter (new cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell BeginEdit (new cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b style=""&gt;&lt;span style=""&gt;When moving from one row to another you get:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell Leave (old cell), Row leave (old row)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell Validating/ed (old cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell EndEdit (old cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Row Validating/ed (old row)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Row Enter (new row)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;6)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell Enter (new cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;7)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Cell BeginEdit (new cell)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903431"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Validating Data&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When validating user data, you will usually validate the data at the cell level when the grid is not databound, and at the row level when the grid is databound. Sometimes when databound you will perform validation both at the cell and row level. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.2.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Displaying error information&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When you do encounter data that is invalid you usually notify the user about it. There are many ways to do this; the conventional way is to use a message box. The DataGridview has the ability to show an error icon for the cell and rows to indicate that invalid data was entered. The error icon has a tooltip associated with it to provide informational about what is in error:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1034" type="#_x0000_t75" style="'width:207.75pt;height:165.75pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image015.png" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image016.jpg" shapes="_x0000_i1034" width="277" border="0" height="221" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_show%20the%20error%20icon%20when%20t"&gt;&lt;span style=""&gt;How do I show the error icon when the user is editing the cell? &lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903432"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Data Entry in the New Row&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When you use a DataGridView for editing data in your application, you will often want to give your users the ability to add new rows of data to the data store. The DataGridView control supports this functionality by providing a row for new records, which is always shown as the last row. It is marked with an asterisk (*) symbol in its row header. The following sections discuss some of the things you should consider when you program with the row for new records enabled. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Displaying the Row for New Records&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Use the AllowUserToAddRows property to indicate whether the row for new records is displayed. The default value of this property is true.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The new row is the last row in the grid:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1035" type="#_x0000_t75" style="'width:195.75pt;height:144.75pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image017.emz" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image018.gif" shapes="_x0000_i1035" width="261" border="0" height="193" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;For the data bound case, the row for new records will be shown if the AllowUserToAddRows property of the control and the IBindingList.AllowNew property of the data source are both true. If either is false then the row will not be shown. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Populating the Row for New Records with Default Data&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When the user selects the row for new records as the current row, the DataGridView control raises the DefaultValuesNeeded event. This event provides access to the new DataGridViewRow and enables you to populate the new row with default data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following code example demonstrates how to specify default values for new rows using the DefaultValuesNeeded event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;private&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; dataGridView1_DefaultValuesNeeded(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style=""&gt;                              &lt;/span&gt;&lt;b&gt;&lt;span style="color: navy;"&gt;DataGridViewRowEventArgs&lt;/span&gt;&lt;/b&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;e.Row.Cells[&lt;span style="color: olive;"&gt;"Region"&lt;/span&gt;].Value = &lt;span style="color: olive;"&gt;"WA"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;e.Row.Cells[&lt;span style="color: olive;"&gt;"City"&lt;/span&gt;].Value = &lt;span style="color: olive;"&gt;"&lt;st1:place st="on"&gt;&lt;st1:city st="on"&gt;Redmond&lt;/st1:city&gt;&lt;/st1:place&gt;"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;e.Row.Cells[&lt;span style="color: olive;"&gt;"PostalCode"&lt;/span&gt;].Value = &lt;span style="color: olive;"&gt;"98052-6399"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;e.Row.Cells[&lt;span style="color: olive;"&gt;"Region"&lt;/span&gt;].Value = &lt;span style="color: olive;"&gt;"NA"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;e.Row.Cells[&lt;span style="color: olive;"&gt;"Country"&lt;/span&gt;].Value = &lt;span style="color: olive;"&gt;"&lt;st1:place st="on"&gt;&lt;st1:country-region st="on"&gt;USA&lt;/st1:country-region&gt;&lt;/st1:place&gt;"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;    &lt;/span&gt;e.Row.Cells[&lt;span style="color: olive;"&gt;"CustomerID"&lt;/span&gt;].Value = NewCustomerId();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;The Rows Collection and the New Row&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The row for new records is contained in the DataGridView control's Rows collection, so the following line returns the new row:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;"&gt;DataGridViewRow&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; row = dataGridView1.Rows[dataGridView1.Rows.Count - 1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Even though the new row is in the rows collection it does behaves differently in two respects: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style=""&gt;The row for new records cannot be      removed from the Rows collection programmatically. An      InvalidOperationException is thrown if this is attempted. The user also      cannot delete the row for new records. The DataGridViewRowCollection.Clear      method does not remove this row from the Rows collection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style=""&gt;No row can be added after the row for      new records. An InvalidOperationException is raised if this is attempted.      As a result, the row for new records is always the last row in the      DataGridView control. The methods on DataGridViewRowCollection that add      rows—Add, AddCopy, and AddCopies—all call insertion methods internally      when the row for new records is present.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Typing in the New Row&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Before a user starts to type in the new row the row’s IsNewRow property returns true. When the user starts to type in the new row, that row no longer is considered the new row, but a “new” new row is added:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1036" type="#_x0000_t75" style="'width:194.25pt;height:152.25pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image019.emz" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image020.gif" shapes="_x0000_i1036" width="259" border="0" height="203" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When this “new” new row is added the UserAddedRow event fires with the Row event args property identifying the “new” new row. If the user hits the Escape key at this stage the “new” new row is removed. This causes the UserDeletingRow event to fire with the Row event args property identifying the “new” new row. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Visual Customization of the Row for New Records&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When the row for new records is created, it is based on the row specified by the RowTemplate property. Any cell styles that are not specified for this row are inherited from other properties. For more information about cell style inheritance, see the Cell Styles topic later in this document.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The initial values displayed by cells in the row for new records are retrieved from each cell's DefaultNewRowValue property. For cells of type DataGridViewImageCell, this property returns a placeholder image. Otherwise, this property returns null. You can override this property to return a custom value. However, these initial values can be replaced by a DefaultValuesNeeded event handler when focus enters the row for new records.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The standard icons for this row's header, which are an arrow or an asterisk, are not exposed publicly. If you want to customize the icons, you will need to create a custom DataGridViewRowHeaderCell class. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The standard icons use the ForeColor property of the DataGridViewCellStyle in use by the row header cell. The standard icons are not rendered if there is not enough space to display them completely.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If the row header cell has a string value set, and if there is not enough room for both the text and icon, the icon is dropped first. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.6&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Sorting the New Row&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;In unbound mode, new records will always be added to the end of the DataGridView even if the user has sorted the content of the DataGridView. The user will need to apply the sort again in order to sort the row to the correct position; this behavior is similar to that of the ListView control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;In data bound and virtual modes, the insertion behavior when a sort is applied will be dependent on the implementation of the data model. For ADO.NET, the row is immediately sorted into the correct position.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.7&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Other Notes on the Row for New Records&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You cannot set the Visible property of this row to false. An InvalidOperationException is raised if this is attempted.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The row for new records is always created in the unselected state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4 style="margin-left: 58.5pt; text-indent: -40.5pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.1.3.8&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Virtual Mode&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If you are implementing virtual mode, you will need to track when a row for new records is needed in the data model and when to roll back the addition of the row. The exact implementation of this functionality depends on the implementation of the data model and its transaction semantics, for example, whether commit scope is at the cell or row level. See the Virtual Mode topic later in this document for more info.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903433"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Working with Null values&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When working with datasource such as a database or a business object it is common to deal with null values. Null values can be an actual null (nothing in VB) or a database “null value” (DBNull.Value).&lt;span style=""&gt;  &lt;/span&gt;When working with these values you’ll need to decide how you will display them. In addition there are valid reasons for when you’ll want to write a null value. Using the cell style’s NullValue and DataSourceNullValue properties you can change how the DataGridView works with null values. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903434"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.2.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;NullValue&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewCellStyle.NullValue property should have been called FormattedNullValue, but it was too late to make this change. Hopefully this provides a clue into how the NullValue is used – at formatting time. When a cell’s value is “null” (equal to Null or DBNull.Value) the value in the DataGridViewCellStyle.NullValue property is used for display. The default value of this property is based upon the column:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 154.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView column&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 232.1pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Column’s DefaultCellStyle.NullValue&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;TextBoxColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 232.1pt;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;String.Empty   (“”)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ImageColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 232.1pt;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Null   image (&lt;/span&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1037" type="#_x0000_t75" style="'width:10.5pt;height:12pt'" ole=""&gt;    &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image021.png" title=""&gt;   &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image022.jpg" shapes="_x0000_i1037" width="14" border="0" height="16" /&gt;&lt;!--[endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;    &lt;o:oleobject type="Embed" progid="PBrush" shapeid="_x0000_i1037" drawaspect="Content" objectid="_1278164745"&gt;    &lt;/o:OLEObject&gt;   &lt;/xml&gt;&lt;![endif]--&gt;)&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ComboBoxColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 232.1pt;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;String.Empty   (“”)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ButtonColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 232.1pt;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;String.Empty   (“”)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;LinkColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 232.1pt;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;String.Empty   (“”)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;CheckBoxColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 232.1pt;" width="309"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Default   is based upon the ThreeState property. If true default value is CheckState.Indeterminate;   otherwise it is false (unchecked).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;What is important to understand is that the NullValue is also used when the user enters data. For example, if the user enters String.Empty into a text box cell then Null is entered as the cell’s value (check out the DataSourceNullValue below for more details on what is actually entered as the cell’s value). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903435"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.2.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataSourceNullValue&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewCellStyle.DataSourceNullValue property could have been called ParseNullValue if the other property was FormattedNullValue, but in the end DataSourceNullValue made good sense. The DataSourceNullValue property is used when writing the value of “Null” to the cell’s value. In databound scenarios this value gets written to the database or business object. This is important to control as business objects and databases have different concepts of null. Usually you’ll want to set DataSourceNullValue to null when working with business objects and DBNull.Value when working with databases. The default value of DataSourceNullValue is DBNull.Value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903436"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;DataError event&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataError event gets its own topic because it is quite common for the DataError event to occur when working with data and the DataGridView. Basically the DataError event occurs anytime the grid is working with data and the grid cannot read/write or convert the cell’s data or when an exception occurs when attempting to perform certain edit operations. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;DataError Event for Edit Operations&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following list identifies edit operations when the DataError event might be raised if an exception occurs: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="margin-left: 4.5pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 189pt;" width="252"&gt;   &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Canceling an edit&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 3in;" width="288"&gt;   &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Refreshing an edit (via the RefreshEdit   method)&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 189pt;" width="252"&gt;   &lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style=""&gt;Ending an edit&lt;/li&gt;&lt;/ul&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 3in;" width="288"&gt;   &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When we attempt to push a cell's value to the   datasource&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 189pt;" width="252"&gt;   &lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style=""&gt;Committing an edit&lt;/li&gt;&lt;/ul&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 3in;" width="288"&gt;   &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Initializing the editing control's\cell's   value (via setting the cell's FormattedValue property or cell's   InitializeEditingControl method.)&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 189pt;" width="252"&gt;   &lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style=""&gt;Deleting a row&lt;/li&gt;&lt;/ul&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 3in;" width="288"&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;DataError Contexts &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following list identifies different DataErrorContexts and provides more detail into when a certain context might occur &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 154.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataErrorContext&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 313.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;When it might occur&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;Formatting&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   attempting to retrieve the cell's formatted value.&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;Display&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   attempting to paint the cell or calculate the cell's tooltiptext. Note that   these operations usually also require getting the cell's formatted value, so   the error context is OR'd together.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;PreferredSize&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   calculating the preferred size of a cell. This&lt;br /&gt;  usually also requires getting the cell's formatted value also.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;RowDeletion&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;Any exception   raised when deleting a row.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;Parsing&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur when committing, ending or canceling an edit. Usually OR'd   in with other error contexts&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;Commit&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur when committing an edit. Usually OR'd with other error   contexts&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;InitialValueRestoration&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur while either initializing the editing control/cell's value,   or Canceling an edit&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;LeaveControl&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur while attempting to validate grid data when the grid is   losing focus. Usually OR'd with other error contexts.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;CurrentCellChange&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur while validating\updating\committing\getting cell content   when the current cell changes. Usually OR'd with other error contexts.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;Scroll&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur while validating\updating\committing\getting cell content   when the current cell changes as a result of scrolling.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 154.9pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;ClipboardContent&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 313.05pt;" width="417"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;When   exceptions occur while attempting to get the formatted value of a cell while   creating the clipboard content.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903437"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Databound modes&lt;/a&gt;&lt;/h2&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903438"&gt;&lt;/a&gt;&lt;a name="_Toc116373085"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.4.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Unbound&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Unbound mode is suitable for displaying relatively small amounts of data that you manage programmatically. You do not attach the DataGridView control directly to a data source as in bound mode. Instead, you must populate the control yourself, typically by using the DataGridViewRowCollection.Add method. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Unbound mode can be particularly useful for static, read-only data, or when you want to provide your own code that interacts with an external data store. When you want your users to interact with an external data source, however, you will typically use bound mode. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903439"&gt;&lt;/a&gt;&lt;a name="_Toc116373086"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.4.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Bound&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Bound mode is suitable for managing data using automatic interaction with the data store. You can attach the DataGridView control directly to its data source by setting the DataSource property. When the control is data bound, data rows are pushed and pulled without the need of explicit management on your part. When the AutoGenerateColumns property is true, each column in your data source will cause a corresponding column to be created in the control. If you prefer to create your own columns, you can set this property to false and use the DataPropertyName property to bind each column when you configure it. This is useful when you want to use a column type other than the types that are generated by default. For more info on databinding the DataGridView, check out the following MSDN article:&lt;span style=""&gt;  &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms11162004.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms11162004.asp&lt;/a&gt; Also, check out the DataBinding FAQ posted at WindowsForms.net&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.4.2.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Valid Data Sources&lt;/h4&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Binding data to the DataGridView control is straightforward and intuitive, and in many cases it is as simple as setting the DataSource property. When you bind to a data source that contains multiple lists or tables, you need to set the DataMember property to a string to specify the list or table to bind to. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control supports the standard Windows Forms data binding model, so it will bind to instances of classes described in the following list: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="BulletList"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Any class that implements the IList interface, including one-dimensional arrays.&lt;/p&gt;  &lt;p class="BulletList"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Any class that implements the IListSource interface, such as the DataTable and DataSet classes.&lt;/p&gt;  &lt;p class="BulletList"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Any class that implements the IBindingList interface, such as the BindingList class.&lt;/p&gt;  &lt;p class="BulletList" style="margin-bottom: 6pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Any class that implements the IBindingListView interface, such as the BindingSource class.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;List Change Notification&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;One of the most important parts when databinding is for the list to support change notifications. This is only important if you want the DataGridView to be updated when the list changes such as add, updates and deletes. Only datasources that implement the IBindingList support change notification. Lists such as arrays or collections do not support change notification by default.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The BindingSource component is the preferred data source because it can bind to a wide variety of data sources and can resolve many data binding issues automatically. Typically, you will bind to a BindingSource component and bind the BindingSource component to another data source or populate it with business objects. The BindingList&lt;t&gt; class can also be used to create a custom list based upon a type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;Object Change Notification&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Once you have a datasource the objects in the datasource optionally can implement change notification for public properties. This is done by either providing a “PropertyName”Changed event for the property or by implementing the INotifyPropertyChanged interface.&lt;span style=""&gt;  &lt;/span&gt;The INotifyPropertyChanged interface is new in VS 2005 and can be used with BindingList&lt;t&gt; to create bindable lists. When your datasource is a BindingSource, the objects in the list do not need to implement change notification.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903440"&gt;&lt;/a&gt;&lt;a name="_Toc116373087"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.4.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Virtual&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With virtual mode, you can implement your own data management operations. This is necessary to maintain the values of unbound columns in bound mode when the control is sorted by bound columns. The primary use of virtual mode, however, is to optimize performance when interacting with large amounts of data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You attach the DataGridView control to a cache that you manage, and your code controls when data rows are pushed and pulled. To keep the memory footprint small, the cache should be similar in size to the number of rows currently displayed. When the user scrolls new rows into view, your code requests new data from the cache and optionally flushes old data from memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When you are implementing virtual mode, you will need to track when a new row is needed in the data model and when to rollback the addition of the new row. The exact implementation of this functionality will depend on the implementation of the data model and the transaction semantics of the data model; whether commit scope is at the cell or row level.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;For more info about Virtual mode, see the “Virtual Mode” topic later in this document.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903441"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.4.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Mixed mode – Bound and Unbound&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The data you display in the DataGridView control will normally come from a data source of some kind, but you might want to display a column of data that does not come from the data source. This kind of column is called an unbound column. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can add unbound columns to a DataGridView control in bound mode. This is useful when you want to display a column of buttons or links that enable users to perform actions on specific rows. It is also useful to display columns with values calculated from bound columns. You can populate the cell values for calculated columns in a handler for the CellFormatting event. If you are using a DataSet or DataTable as the data source, however, you might want to use the DataColumn.Expression property to create a calculated column instead. In this case, the DataGridView control will treat calculated column just like any other column in the data source. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Sorting by unbound columns in bound mode is not supported. If you create an unbound column in bound mode that contains user-editable values, you must implement virtual mode to maintain these values when the control is sorted by a bound column. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Virtual mode should also be used in mix mode when the additional data being displayed cannot be calculated based upon the data that the grid is bound to or when the data is updated frequently. For more info about Virtual mode, see the “Virtual Mode” topic later in this document.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;a name="_Toc116373088"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_show%20unbound%20data%20along%20wi"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I show unbound data along with bound data?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_show%20data%20that%20comes%20from%20"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I show data that comes from two tables?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;3)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_show%20master-details?"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I show master-details?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;4)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_show%20master-details%20in%20the"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I show master-details in the same DataGridView?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;5)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_prevent%20sorting?"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I prevent sorting?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;6)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_sort%20on%20multiple%20columns?"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I sort on multiple columns?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;7)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_have%20a%20combo%20box%20column%20di"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I have a combo box column display a sub set of data based upon the value of a different combo box column?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;8)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_commit%20the%20data%20to%20the%20dat"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I commit the data to the database when clicking on a toolstrip button?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;9)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_display%20a%20confirmation%20dia"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I display a confirmation dialog when the user tries to delete a row?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h1 style="margin-left: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903442"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Mangal;"&gt;&lt;span style=""&gt;5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Overview of features&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903443"&gt;&lt;/a&gt;&lt;a name="_Toc116373090"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Styling&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;a name="_Toc116373089"&gt;&lt;span style=""&gt;The DataGridView control makes it easy to define the basic appearance of cells and the display formatting of cell values. You can define appearance and formatting styles for individual cells, for cells in specific columns and rows, or for all cells in the control by setting the properties of the DataGridViewCellStyle objects accessed through various DataGridView control properties. Additionally, you can modify these styles dynamically based on factors such as the cell value by handling the CellFormatting event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;span style=""&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Each cell within the DataGridView control can have its own style, such as text format, background color, foreground color, and font. Typically, however, multiple cells will share particular style characteristics. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Groups of cells that share styles may include all cells within particular rows or columns, all cells that contain particular values, or all cells in the control. Because these groups overlap, each cell may get its styling information from more than one place. For example, you may want every cell in a DataGridView control to use the same font, but only cells in currency columns to use currency format, and only currency cells with negative numbers to use a red foreground color. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903444"&gt;&lt;/a&gt;&lt;a name="_Toc116373091"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.1.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;The DataGridViewCellStyle Class&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewCellStyle class contains the following properties related to visual style: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;BackColor and ForeColor, SelectionBackColor and SelectionForeColor, Font&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;This class also contains the following properties related to formatting: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;Format and FormatProvider, NullValue and DataSourceNullValue, WrapMode, Alignment, Padding&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903445"&gt;&lt;/a&gt;&lt;a name="_Toc116373092"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.1.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Using DataGridViewCellStyle Objects&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can retrieve DataGridViewCellStyle objects from various properties of the DataGridView, DataGridViewColumn, DataGridViewRow, and DataGridViewCell classes and their derived classes. If one of these properties has not yet been set, retrieving its value will create a new DataGridViewCellStyle object. You can also instantiate your own DataGridViewCellStyle objects and assign them to these properties. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can avoid unnecessary duplication of style information by sharing DataGridViewCellStyle objects among multiple DataGridView elements. Because the styles set at the control, column, and row levels filter down through each level to the cell level, you can also avoid style duplication by setting only those style properties at each level that differ from the levels above. This is described in more detail in the Style Inheritance section that follows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table lists the primary properties that get or set DataGridViewCellStyle objects. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 153pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Property &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 99pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Classes &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 225pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DefaultCellStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;, &lt;span style=""&gt;DataGridViewColumn&lt;/span&gt;, &lt;span style=""&gt;DataGridViewRow&lt;/span&gt;,   and derived classes &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets or   sets default styles used by all cells in the entire control (including header   cells), in a column, or in a row.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowsDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets or   sets default cell styles used by all rows in the control. This does not   include header cells.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AlternatingRowsDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets or   sets default cell styles used by alternating rows in the control. Used to   create a ledger-like effect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowHeadersDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets or   sets default cell styles used by the control's row headers. Overridden by the   current theme if visual styles are enabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ColumnHeadersDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridView&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets or   sets default cell styles used by the control's column headers. Overridden by   the current theme if visual styles are enabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Style&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCell&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt; and derived classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets or   sets styles specified at the cell level. These styles override those   inherited from higher levels.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;InheritedStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 99pt;" width="132"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCell&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;, &lt;span style=""&gt;DataGridViewRow&lt;/span&gt;, &lt;span style=""&gt;DataGridViewColumn&lt;/span&gt;,   and derived classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 225pt;" width="300"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Gets all   the styles currently applied to the cell, row, or column, including styles   inherited from higher levels.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;As mentioned above, getting the value of a style property automatically instantiates a new DataGridViewCellStyle object if the property has not been previously set. To avoid creating these objects unnecessarily, the row and column classes have a HasDefaultCellStyle property that you can check to determine whether the DefaultCellStyle property has been set. Similarly, the cell classes have a HasStyle property that indicates whether the Style property has been set. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Each of the style properties has a corresponding PropertyNameChanged event on the DataGridView control. For row, column, and cell properties, the name of the event begins with "Row", "Column", or "Cell" (for example, RowDefaultCellStyleChanged). Each of these events occurs when the corresponding style property is set to a different DataGridViewCellStyle object. These events do not occur when you retrieve a DataGridViewCellStyle object from a style property and modify its property values. To respond to changes to the cell style objects themselves, handle the CellStyleContentChanged event. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903446"&gt;&lt;/a&gt;&lt;a name="_Toc116373093"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.1.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Style Inheritance&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Each DataGridViewCell gets its appearance from its InheritedStyle property. The DataGridViewCellStyle object returned by this property inherits its values from a hierarchy of properties of type DataGridViewCellStyle. These properties are listed below in the order in which the InheritedStyle for non-header cells obtains its values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCell.Style&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewRow.DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AlternatingRowsDefaultCellStyle (only for cells in rows with odd index numbers)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowsDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewColumn.DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;For row and column header cells, the InheritedStyle property is populated by values from the following list of source properties in the given order.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCell.Style&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ColumnHeadersDefaultCellStyle or RowHeadersDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following diagram illustrates this process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1038" type="#_x0000_t75" style="'width:249pt;height:221.25pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image023.emz" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image024.gif" shapes="_x0000_i1038" width="332" border="0" height="295" /&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can also access the styles inherited by specific rows and columns. The column InheritedStyle property inherits its values from the following properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewColumn.DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The row InheritedStyle property inherits its values from the following properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewRow.DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AlternatingRowsDefaultCellStyle (only for cells in rows with odd index numbers)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowsDefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DefaultCellStyle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;For each property in a DataGridViewCellStyle object returned by an InheritedStyle property, the property value is obtained from the first cell style in the appropriate list that has the corresponding property set to a value other than the DataGridViewCellStyle class defaults.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table illustrates how the ForeColor property value for an example cell is inherited from its containing column. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 275.8pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Property of type DataGridViewCellStyle &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 192.15pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Example ForeColor value for retrieved object &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 275.8pt;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewCell.Style&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 192.15pt;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Color.Empty&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 275.8pt;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewRow.DefaultCellStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 192.15pt;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Color.Red&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 275.8pt;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AlternatingRowsDefaultCellStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 192.15pt;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Color.Empty&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 275.8pt;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowsDefaultCellStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 192.15pt;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Color.Empty&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 275.8pt;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewColumn.DefaultCellStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 192.15pt;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Color.DarkBlue&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 275.8pt;" width="368"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DefaultCellStyle&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 192.15pt;" width="256"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Color.Black&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;In this case, the System.Drawing.Color.Red value from the cell's row is the first real value on the list. This becomes the ForeColor property value of the cell's InheritedStyle.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following diagram illustrates how different DataGridViewCellStyle properties can inherit their values from different places. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1039" type="#_x0000_t75" style="'width:264pt;height:211.5pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image025.emz" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image026.gif" shapes="_x0000_i1039" width="352" border="0" height="282" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By taking advantage of style inheritance, you can provide appropriate styles for the entire control without having to specify the same information in multiple places.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Although header cells participate in style inheritance as described, the objects returned by the ColumnHeadersDefaultCellStyle and RowHeadersDefaultCellStyle properties of the DataGridView control have initial property values that override the property values of the object returned by the DefaultCellStyle property. If you want the properties set for the object returned by the DefaultCellStyle property to apply to row and column headers, you must set the corresponding properties of the objects returned by the ColumnHeadersDefaultCellStyle and RowHeadersDefaultCellStyle properties to the defaults indicated for the DataGridViewCellStyle class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;If visual styles are enabled, the row and column headers (except for the TopLeftHeaderCell) are automatically styled by the current theme, overriding any styles specified by these properties. Set the EnableHeadersVisualStyle property to false if you want headers to not use XP’s visual styles.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridViewButtonColumn, DataGridViewImageColumn, and DataGridViewCheckBoxColumn types also initialize some values of the object returned by the column DefaultCellStyle property. For more information, see the reference documentation for these types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903447"&gt;&lt;/a&gt;&lt;a name="_Toc116373094"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.1.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Setting Styles Dynamically&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;To customize the styles of cells with particular values, implement a handler for the CellFormatting event. Handlers for this event receive an argument of the DataGridViewCellFormattingEventArgs type. This object contains properties that let you determine the value of the cell being formatted along with its location in the DataGridView control. This object also contains a CellStyle property that is initialized to the value of the InheritedStyle property of the cell being formatted. You can modify the cell style properties to specify style information appropriate to the cell value and location. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;The RowPrePaint and RowPostPaint events also receive a DataGridViewCellStyle object in the event data, but in their case, it is a copy of the row InheritedStyle property for read-only purposes, and changes to it do not affect the control. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can also dynamically modify the styles of individual cells in response to events such as the CellMouseEnter and CellMouseLeave events. For example, in a handler for the CellMouseEnter event, you could store the current value of the cell background color (retrieved through the cell's Style property), then set it to a new color that will highlight the cell when the mouse hovers over it. In a handler for the CellMouseLeave event, you can then restore the background color to the original value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;Caching the values stored in the cell's Style property is important regardless of whether a particular style value is set. If you temporarily replace a style setting, restoring it to its original "not set" state ensures that the cell will go back to inheriting the style setting from a higher level. If you need to determine the actual style in effect for a cell regardless of whether the style is inherited, use the cell's InheritedStyle property.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903448"&gt;&lt;/a&gt;&lt;a name="_Toc116373095"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Custom painting&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control provides several properties that you can use to adjust the appearance and basic behavior (look and feel) of its cells, rows, and columns. If you have requirements that go beyond the capabilities of the DataGridViewCellStyle class, you can perform custom drawing of the cell or row content. To paint cells and rows yourself, you can handle various DataGridView painting events such as RowPrePaint, CellPainting and RowPostPaint. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903449"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.2.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Paint Parts&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;One important part of custom painting is the concept of paint parts. The DataGridViewPainParts enumeration is used to specify what parts a cell paints. Enum values can be combined together to have a cell paint or not paint specific parts. Here are the different parts:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 1.5in; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;PaintPart&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 359.95pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Example ForeColor value for retrieved object &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;All&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;All parts   are painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Background&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The   background of the cell is painted using the cell’s background color (1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Border&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The borders are painted&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ContentBackground&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The background part of the cell’s content is   painted. (2)&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ContentForeground&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The   foreground part of the cell’s content is painted (2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ErrorIcon&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The error   icon is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Focus&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The focus   rectangle for the cell is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;None&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;No parts   are painted (1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 1.5in;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;SelectionBackground&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 359.95pt;" width="480"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The   background is painted selected if the cell is selected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style="margin-top: 6pt;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt;"&gt;Notes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;If a cell does not paint its background then nothing is painted. A row or column performs no painting, so ensure that at least the cell’s background is painted or you perform your own custom background painting; otherwise the rectangle remains invalidated (unpainted). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;Each cell determines what it paints as content foreground and content background as described by the following list:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="margin-left: 63pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell Type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Content   Foreground&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Content   Background&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border: medium none ; padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Text box&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border: medium none ; padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell text   is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border: medium none ; padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Nothing   painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Button&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell text   is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Button is   painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Combo box&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell text   is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Combo box   is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Check box&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Check box   is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Nothing   painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Link&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell text   is painted as a link&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Nothing   is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Image&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell   image is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Nothing   painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Column   Header&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Column   header text&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Sort   Glyph is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="padding: 0in 4.5pt; width: 85.5pt;" width="114"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Row   Header&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 148.5pt;" valign="top" width="198"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Row   header text&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="padding: 0in 4.5pt; width: 153pt;" width="204"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Current   row triangle, edit pencil and new row indicator is painted&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903450"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.2.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Row Pre Paint and Post Paint&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can control the appearance of DataGridView rows by handling one or both of the DataGridView.RowPrePaint and DataGridView.RowPostPaint events. These events are designed so that you can paint only what you want to while letting the DataGridView control paint the rest. For example, if you want to paint a custom background, you can handle the DataGridView.RowPrePaint event and let the individual cells paint their own foreground content. In the RowPrePaint event you can set the PaintParts event args property to easily customize how the cells paint. For example, if you want to keep cells from painting any selection or focus, your RowPrePaint event would set the PaintParts property like so:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 6pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;e.PaintParts = &lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.All &amp;amp;&lt;br /&gt;&lt;span style=""&gt;       &lt;/span&gt;~(&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.Focus |&lt;br /&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.SelectionBackground);&lt;/span&gt;&lt;span style="font-size: 9pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 6pt;"&gt;&lt;span style=""&gt;Which could also be written as:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;e.PaintParts = (&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.Background |&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.Border |&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.ContentBackground |&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.ContentForeground |&lt;br /&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;b&gt;&lt;span style="color: teal;"&gt;DataGridViewPaintParts&lt;/span&gt;&lt;/b&gt;.ErrorIcon);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Alternately, you can let the cells paint themselves and add custom foreground content in a handler for the DataGridView.RowPostPaint event. You can also disable cell painting and paint everything yourself in a DataGridView.RowPrePaint event handler&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903451"&gt;&lt;/a&gt;&lt;a name="_Toc116373103"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Autosizing&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control provides numerous options for customizing the sizing behavior of its columns and rows. Typically, DataGridView cells do not resize based on their contents. Instead, they clip any display value that is larger than the cell. If the content can be displayed as a string, the cell displays it in a ToolTip. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By default, users can drag row, column, and header dividers with the mouse to show more information. Users can also double-click a divider to automatically resize the associated row, column, or header band based on its contents. Columns share the available width of the control by default, so if users can resize the control—for example, if it is docked to a resizable form—they can also change the available display space for all columns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The DataGridView control provides properties, methods, and events that enable you to customize or disable all of these user-directed behaviors. Additionally, you can programmatically resize rows, columns, and headers to fit their contents, or you can configure them to automatically resize themselves whenever their contents change.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_force%20a%20row%20to%20commit%20its%20"&gt;&lt;span style=""&gt;How do I make the last column wide enough to occupy all the remaining client area of the grid?&lt;/span&gt;&lt;/a&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903452"&gt;&lt;/a&gt;&lt;a name="_Toc116373104"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Sizing Options in the Windows Forms DataGridView Control&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;DataGridView rows, columns, and headers can change size as a result of many different occurrences. The following table shows these occurrences.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 68.35pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="91"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Occurrence &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 419.6pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="559"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 68.35pt;" width="91"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;User   resize&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 419.6pt;" width="559"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Users can   make size adjustments by dragging or double-clicking row, column, or header   dividers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 68.35pt;" width="91"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Control   resize&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 419.6pt;" width="559"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;In column   fill mode, column widths change when the control width changes; for example,   when the control is docked to its parent form and the user resizes the form.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 68.35pt;" width="91"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Cell value   change&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 419.6pt;" width="559"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;In   content-based automatic sizing modes, sizes change to fit new display values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 68.35pt;" width="91"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Method   call&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 419.6pt;" width="559"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Programmatic   content-based resizing lets you make opportunistic size adjustments based on   cell values at the time of the method call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 68.35pt;" width="91"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Property   setting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 419.6pt;" width="559"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;You can   also set specific height and width values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By default, user resizing is enabled, automatic sizing is disabled, and cell values that are wider than their columns are clipped. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table shows scenarios that you can use to adjust the default behavior or to use specific sizing options to achieve particular effects. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 237.3pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Scenario &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 230.65pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Implementation &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Use   column fill mode for displaying similarly sized data in a relatively small   number of columns that occupy the entire width of the control without   displaying the horizontal scroll bar.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Set the   AutoSizeColumnsMode property to Fill. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Use   column fill mode with display values of varying sizes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Set the &lt;b&gt;AutoSizeColumnsMode&lt;/b&gt;   property to &lt;b&gt;Fill&lt;/b&gt;. Initialize relative column widths by setting the   column FillWeight properties or by calling the control AutoResizeColumns   method after filling the control with data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Use   column fill mode with values of varying importance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Set the &lt;b&gt;AutoSizeColumnsMode&lt;/b&gt;   property to &lt;b&gt;Fill&lt;/b&gt;. Set large MinimumWidth values for columns that must   always display some of their data or use a sizing option other than fill mode   for specific columns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Use   column fill mode to avoid displaying the control background.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Set the   AutoSizeMode property of the last column to Fill and use other sizing options   for the other columns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Display a   fixed-width column, such as an icon or ID column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Set &lt;b&gt;AutoSizeMode&lt;/b&gt;   to None and Resizable to False for the column. Initialize its width by   setting the Width property or by calling the control AutoResizeColumn method   after filling the control with data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Adjust   sizes automatically whenever cell contents change to avoid clipping and to   optimize the use of space.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Set an   automatic sizing property to a value that represents a content-based sizing   mode. To avoid a performance penalty when working with large amounts of data,   use a sizing mode that calculates displayed rows only. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Adjust   sizes to fit values in displayed rows to avoid performance penalties when   working with many rows. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Use the   appropriate sizing-mode enumeration values with automatic or programmatic   resizing. To adjust sizes to fit values in newly displayed rows while   scrolling, call a resizing method in a Scroll event handler. To customize   user double-click resizing so that only values in displayed rows determine   the new sizes, call a resizing method in a RowDividerDoubleClick or   ColumnDividerDoubleClick event handler.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Adjust   sizes to fit cell contents only at specific times to avoid performance   penalties or to enable user resizing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Call a   content-based resizing method in an event handler. For example, use the   DataBindingComplete event to initialize sizes after binding, and handle the   CellValidated or CellValueChanged event to adjust sizes to compensate for   user edits or changes in a bound data source.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 237.3pt;" width="316"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Adjust   row heights for multiline cell contents.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 230.65pt;" width="308"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Ensure   that column widths are appropriate for displaying paragraphs of text and use   automatic or programmatic content-based row sizing to adjust the heights.   Also ensure that cells with multiline content are displayed using a WrapMode   cell style value of True.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Typically,   you will use an automatic column sizing mode to maintain column widths or set   them to specific widths before row heights are adjusted. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903453"&gt;&lt;/a&gt;&lt;a name="_Toc116373105"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Resizing with the Mouse&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By default, users can resize rows, columns, and headers that do not use an automatic sizing mode based on cell values. To prevent users from resizing with other modes, such as column fill mode, set one or more of the following DataGridView properties:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AllowUserToResizeColumns&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AllowUserToResizeRows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ColumnHeadersHeightSizeMode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowHeadersWidthSizeMode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can also prevent users from resizing individual rows or columns by setting their Resizable properties. By default, the Resizable property value is based on the AllowUserToResizeColumns property value for columns and the AllowUserToResizeRows property value for rows. If you explicitly set Resizable to True or False, however, the specified value overrides the control value is for that row or column. Set Resizable to NotSet to restore the inheritance. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Because NotSet restores the value inheritance, the Resizable property will never return a NotSet value unless the row or column has not been added to a DataGridView control. If you need to determine whether the Resizable property value of a row or column is inherited, examine its State property. If the State value includes the ResizableSet flag, the Resizable property value is not inherited. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903454"&gt;&lt;/a&gt;&lt;a name="_Toc116373106"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Automatic Sizing&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;There are two kinds of automatic sizing in the DataGridView control: column fill mode and content-based automatic sizing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Column fill mode causes the visible columns in the control to fill the width of the control's display area. For more information about this mode, see the Column Fill Mode section below. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can also configure rows, columns, and headers to automatically adjust their sizes to fit their cell contents. In this case, size adjustment occurs whenever cell contents change. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;If you maintain cell values in a custom data cache using virtual mode, automatic sizing occurs when the user edits a cell value but does not occur when you alter a cached value outside of a CellValuePushed event handler. In this case, call the UpdateCellValue method to force the control to update the cell display and apply the current automatic sizing modes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If content-based automatic sizing is enabled for one dimension only—that is, for rows but not columns, or for columns but not rows—and WrapMode is also enabled, size adjustment also occurs whenever the other dimension changes. For example, if rows but not columns are configured for automatic sizing and WrapMode is enabled, users can drag column dividers to change the width of a column and row heights will automatically adjust so that cell contents are still fully displayed. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If you configure both rows and columns for content-based automatic sizing and WrapMode is enabled, the DataGridView control will adjust sizes whenever cell contents changed and will use an ideal cell height-to-width ratio when calculating new sizes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;To configure the sizing mode for headers and rows and for columns that do not override the control value, set one or more of the following DataGridView properties:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ColumnHeadersHeightSizeMode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowHeadersWidthSizeMode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoSizeColumnsMode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoSizeRowsMode&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;To override the control's column sizing mode for an individual column, set its AutoSizeMode property to a value other than NotSet. The sizing mode for a column is actually determined by its InheritedAutoSizeMode property. The value of this property is based on the column's AutoSizeMode property value unless that value is NotSet, in which case the control's AutoSizeColumnsMode value is inherited.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Use content-based automatic resizing with caution when working with large amounts of data. To avoid performance penalties, use the automatic sizing modes that calculate sizes based only on the displayed rows rather than analyzing every row in the control. For maximum performance, use programmatic resizing instead so that you can resize at specific times, such as immediately after new data is loaded. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Content-based automatic sizing modes do not affect rows, columns, or headers that you have hidden by setting the row or column Visible property or the control RowHeadersVisible or ColumnHeadersVisible properties to false. For example, if a column is hidden after it is automatically sized to fit a large cell value, the hidden column will not change its size if the row containing the large cell value is deleted. Automatic sizing does not occur when visibility changes, so changing the column Visible property back to true will not force it to recalculate its size based on its current contents. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Programmatic content-based resizing affects rows, columns, and headers regardless of their visibility. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903455"&gt;&lt;/a&gt;&lt;a name="_Toc116373107"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Programmatic Resizing&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When automatic sizing is disabled, you can programmatically set the exact width or height of rows, columns, or headers through the following properties:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowHeadersWidth&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ColumnHeadersHeight&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewRow.Height&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewColumn.Width&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can also programmatically resize rows, columns, and headers to fit their contents using the following methods: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoResizeColumn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoResizeColumns&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoResizeColumnHeadersHeight&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoResizeRow&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoResizeRows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;AutoResizeRowHeadersWidth&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;These methods will resize rows, columns, or headers once rather than configuring them for continuous resizing. The new sizes are automatically calculated to display all cell contents without clipping. When you programmatically resize columns that have InheritedAutoSizeMode property values of Fill, however, the calculated content-based widths are used to proportionally adjust the column FillWeight property values, and the actually column widths are then calculated according to these new proportions so that all columns fill the available display area of the control. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Programmatic resizing is useful to avoid performance penalties with continuous resizing. It is also useful to provide initial sizes for user-resizable rows, columns, and headers, and for column fill mode. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You will typically call the programmatic resizing methods at specific times. For example, you might programmatically resize all columns immediately after loading data, or you might programmatically resize a specific row after a particular cell value has been modified. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903456"&gt;&lt;/a&gt;&lt;a name="_Toc116373108"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3.5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Customizing Content-based Sizing Behavior&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can customize sizing behaviors when working with derived DataGridView cell, row, and column types by overriding the DataGridViewCell.GetPreferredSize(), DataGridViewRow.GetPreferredHeight(), or DataGridViewColumn.GetPreferredWidth() methods or by calling protected resizing method overloads in a derived DataGridView control. The protected resizing method overloads are designed to work in pairs to achieve an ideal cell height-to-width ratio, avoiding overly wide or tall cells. For example, if you call the AutoResizeRows(DataGridViewAutoSizeRowsMode,Boolean) overload of the AutoResizeRows method and pass in a value of false for the Boolean parameter, the overload will calculate the ideal heights and widths for cells in the row, but it will adjust the row heights only. You must then call the AutoResizeColumns method to adjust the column widths to the calculated ideal. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903457"&gt;&lt;/a&gt;&lt;a name="_Toc116373109"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.3.6&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Content-based Sizing Options&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The enumerations used by sizing properties and methods have similar values for content-based sizing. With these values, you can limit which cells are used to calculate the preferred sizes. For all sizing enumerations, values with names that refer to displayed cells limit their calculations to cells in displayed rows. Excluding rows is useful to avoid a performance penalty when you are working with a large quantity of rows. You can also restrict calculations to cell values in header or nonheader cells. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903458"&gt;&lt;/a&gt;&lt;a name="_Toc116373110"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Selection modes&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The DataGridView control provides you with a variety of options for configuring how users can select cells, rows, and columns. For example, you can enable single or multiple selection, selection of whole rows or columns when users click cells, or selection of whole rows or columns only when users click their headers, which enables cell selection as well. If you want to provide your own user interface for selection, you can disable ordinary selection and handle all selection programmatically. Additionally, you can enable users to copy the selected values to the Clipboard. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Sometimes you want your application to perform actions based on user selections within a DataGridView control. Depending on the actions, you may want to restrict the kinds of selection that are possible. For example, suppose your application can print a report for the currently selected record. In this case, you may want to configure the DataGridView control so that clicking anywhere within a row always selects the entire row, and so that only one row at a time can be selected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can specify the selections allowed by setting the SelectionMode property to one of the following DataGridViewSelectionMode enumeration values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 100.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="133"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewSelectionMode value &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 367.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="491"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 100.05pt;" width="133"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;CellSelect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 367.9pt;" width="491"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Clicking   a cell selects it. Row and column headers cannot be used for selection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 100.05pt;" width="133"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;ColumnHeaderSelect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 367.9pt;" width="491"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Clicking   a cell selects it. Clicking a column header selects the entire column. Column   headers cannot be used for sorting.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 100.05pt;" width="133"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;FullColumnSelect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 367.9pt;" width="491"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Clicking   a cell or a column header selects the entire column. Column headers cannot be   used for sorting.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 100.05pt;" width="133"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;FullRowSelect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 367.9pt;" width="491"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Clicking   a cell or a row header selects the entire row.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 100.05pt;" width="133"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;RowHeaderSelect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 367.9pt;" width="491"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Default   selection mode. Clicking a cell selects it. Clicking a row header selects the   entire row.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;Changing the selection mode at run time automatically clears the current selection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By default, users can select multiple rows, columns, or cells by dragging with the mouse, pressing CTRL or SHIFT while selecting to extend or modify a selection, or clicking the top-left header cell to select all cells in the control. To prevent this behavior, set the MultiSelect property to false. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The FullRowSelect and RowHeaderSelect modes allow users to delete rows by selecting them and pressing the DELETE key. Users can delete rows only when the current cell is not in edit mode, the AllowUserToDeleteRows property is set to true, and the underlying data source supports user-driven row deletion. Note that these settings do not prevent programmatic row deletion.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903459"&gt;&lt;/a&gt;&lt;a name="_Toc116373111"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.4.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Programmatic Selection&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The current selection mode restricts the behavior of programmatic selection as well as user selection. You can change the current selection programmatically by setting the Selected property of any cells, rows, or columns present in the DataGridView control. You can also select all cells in the control through the SelectAll method, depending on the selection mode. To clear the selection, use the ClearSelection method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If the MultiSelect property is set to true, you can add DataGridView elements to or remove them from the selection by changing the Selected property of the element. Otherwise, setting the Selected property to true for one element automatically removes other elements from the selection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Note that changing the value of the CurrentCell property does not alter the current selection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can retrieve a collection of the currently selected cells, rows, or columns through the SelectedCells, SelectedRows, and SelectedColumns properties of the DataGridView control. Accessing these properties is inefficient when every cell in the control is selected. To avoid a performance penalty in this case, use the AreAllCellsSelected method first. Additionally, accessing these collections to determine the number of selected cells, rows, or columns can be inefficient. Instead, you should use the GetCellCount, GetRowCount, or GetColumnCount method, passing in the Selected value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc116373112"&gt;&lt;/a&gt;&lt;a name="_Toc119903460"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Scrolling&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;The DataGridView obviously provides scrolling support via the horizontal and vertical scrollbars. It also provides vertical scrolling via the mouse wheel.&lt;span style=""&gt;  &lt;/span&gt;Scrolling horizontally scrolls in pixel values while scrolling vertically scrolls in row index. The DataGridView does not provide support for scrolling rows in pixel increments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903461"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.5.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Scroll event&lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;As you scroll the DataGridView raises the Scroll event that allows you to be notified that scrolling is occurring. The Orientation property on the scroll event args lets you know the scroll direction. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903462"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.5.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Scroll bars&lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;The DataGridView provides access to the scrollbars that it displays via the protected HorizontalScrollBar and VerticalScrollBar properties. Accessing these ScrollBar controls directly allow you to have finer control over scrolling. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903463"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.5.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Scrolling Properties&lt;/a&gt; &lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;There are a set of properties that provide greater level of details on how the DataGridView is scrolled. The diagram highlights these properties and their values at this state. The properties are read/write except for the FirstDisplayedScrollingColumnHiddenWidth and VerticalScrollingOffset properties. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1040" type="#_x0000_t75" style="'width:417.75pt;height:272.25pt'"&gt;  &lt;v:imagedata src="file:///D:\DOCUME~1\shesu04\LOCALS~1\Temp\msohtml1\01\clip_image027.emz" title=""&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;img src="file:///D:/DOCUME%7E1/shesu04/LOCALS%7E1/Temp/msohtml1/01/clip_image028.gif" shapes="_x0000_i1040" width="557" border="0" height="363" /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903464"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.6&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Sorting&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By default, users can sort the data in a DataGridView control by clicking the header of a text box column. You can modify the SortMode property of specific columns to allow users to sort by other column types when it makes sense to do so. You can also sort the data programmatically by any column, or by multiple columns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;DataGridView columns have three sort modes. The sort mode for each column is specified through the SortMode property of the column, which can be set to one of the following DataGridViewColumnSortMode enumeration values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 150.75pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="201"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;DataGridViewColumnSortMode value &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 317.25pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="423"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 150.75pt;" width="201"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Automatic&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 317.25pt;" width="423"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Default   for text box columns. Unless column headers are used for selection, clicking   the column header automatically sorts the &lt;b&gt;DataGridView&lt;/b&gt; by this column   and displays a glyph indicating the sort order.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 150.75pt;" width="201"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;NotSortable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 317.25pt;" width="423"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Default   for non–text box columns. You can sort this column programmatically; however,   it is not intended for sorting, so no space is reserved for the sorting   glyph. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 150.75pt;" width="201"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Programmatic&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 317.25pt;" width="423"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;You can   sort this column programmatically, and space is reserved for the sorting   glyph.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You might want to change the sort mode for a column that defaults to NotSortable if it contains values that can be meaningfully ordered. For example, if you have a database column containing numbers that represent item states, you can display these numbers as corresponding icons by binding an image column to the database column. You can then change the numerical cell values into image display values in a handler for the CellFormatting event. In this case, setting the SortMode property to Automatic will enable your users to sort the column. Automatic sorting will enable your users to group items that have the same state even if the states corresponding to the numbers do not have a natural sequence. Check box columns are another example where automatic sorting is useful for grouping items in the same state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can sort a DataGridView programmatically by the values in any column or in multiple columns, regardless of the SortMode settings. Programmatic sorting is useful when you want to provide your own user interface (UI) for sorting or when you want to implement custom sorting. Providing your own sorting UI is useful, for example, when you set the DataGridView selection mode to enable column header selection. In this case, although the column headers cannot be used for sorting, you still want the headers to display the appropriate sorting glyph, so you would set the SortMode property to Programmatic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Columns set to programmatic sort mode do not automatically display a sorting glyph. For these columns, you must display the glyph yourself by setting the DataGridViewColumnHeaderCell.SortGlyphDirection property. This is necessary if you want flexibility in custom sorting. For example, if you sort the DataGridView by multiple columns, you might want to display multiple sorting glyphs or no sorting glyph.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Although you can programmatically sort a DataGridView by any column, some columns, such as button columns, might not contain values that can be meaningfully ordered. For these columns, a SortMode property setting of NotSortable indicates that it will never be used for sorting, so there is no need to reserve space in the header for the sorting glyph.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When a DataGridView is sorted, you can determine both the sort column and the sort order by checking the values of the SortedColumn and SortOrder properties. These values are not meaningful after a custom sorting operation. For more information about custom sorting, see the Custom Sorting section later in this topic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When a DataGridView control containing both bound and unbound columns is sorted, the values in the unbound columns cannot be maintained automatically. To maintain these values, you must implement virtual mode by setting the VirtualMode property to true and handling the CellValueNeeded and CellValuePushed events.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903465"&gt;&lt;/a&gt;&lt;a name="_Toc116373113"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.6.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Programmatic Sorting&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can sort a DataGridView programmatically by calling its Sort method. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The Sort(DataGridViewColumn,ListSortDirection) overload of the Sort method takes a DataGridViewColumn and a ListSortDirection enumeration value as parameters. This overload is useful when sorting by columns with values that can be meaningfully ordered, but which you do not want to configure for automatic sorting. When you call this overload and pass in a column with a SortMode property value of DataGridViewColumnSortMode.Automatic, the SortedColumn and SortOrder properties are set automatically and the appropriate sorting glyph appears in the column header. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;When the DataGridView control is bound to an external data source by setting the DataSource property, the Sort(DataGridViewColumn,ListSortDirection) method overload does not work for unbound columns. Additionally, when the VirtualMode property is true, you can call this overload only for bound columns. To determine whether a column is data-bound, check the IsDataBound property value. Sorting unbound columns in bound mode is not supported.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903466"&gt;&lt;/a&gt;&lt;a name="_Toc116373114"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.6.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Custom Sorting&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can customize DataGridView by using the Sort(IComparer) overload of the Sort method or by handling the SortCompare event.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The Sort(IComparer) method overload takes an instance of a class that implements the IComparer interface as a parameter. This overload is useful when you want to provide custom sorting; for example, when the values in a column do not have a natural sort order or when the natural sort order is inappropriate. In this case, you cannot use automatic sorting, but you might still want your users to sort by clicking the column headers. You can call this overload in a handler for the ColumnHeaderMouseClick event if you do not use column headers for selection. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;The Sort(IComparer) method overload works only when the DataGridView control is not bound to an external data source and the VirtualMode property value is false. To customize sorting for columns bound to an external data source, you must use the sorting operations provided by the data source. In virtual mode, you must provide your own sorting operations for unbound columns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;To use the Sort(IComparer) method overload, you must create your own class that implements the IComparer interface. This interface requires your class to implement the IComparer.Compare(Object) method, to which the DataGridView passes DataGridViewRow objects as input when the Sort(IComparer) method overload is called. With this, you can calculate the correct row ordering based on the values in any column.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The Sort(IComparer) method overload does not set the SortedColumn and SortOrder properties, so you must always set the DataGridViewColumnHeaderCell.SortGlyphDirection property to display the sorting glyph. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;As an alternative to the Sort(IComparer) method overload, you can provide custom sorting by implementing a handler for the SortCompare event. This event occurs when users click the headers of columns configured for automatic sorting or when you call the Sort(DataGridViewColumn,ListSortDirection) overload of the Sort method. The event occurs for each pair of rows in the control, enabling you to calculate their correct order. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;The SortCompare event does not occur when the DataSource property is set or when the VirtualMode property value is true.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;a name="_Toc116373115"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_prevent%20sorting?"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I prevent sorting?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;/span&gt;&lt;a href="#_How_do_I_sort%20on%20multiple%20columns?"&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;How do I sort on multiple columns?&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903467"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.7&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Border styles&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With the DataGridView control, you can customize the appearance of the control's border and gridlines to improve the user experience. You can modify the gridline color and the control border style in addition to the border styles for the cells within the control. The gridline color is controlled via the GridColor property. You can also apply different cell border styles for ordinary cells, row header cells, and column header cells. For advanced border styles the DataGridView provides the advanced border style properties as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;b style=""&gt;&lt;span style=""&gt;Note: &lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;The gridline color is used only with the Single, SingleHorizontal, and SingleVertical values of the DataGridViewCellBorderStyle enumeration and the Single value of the DataGridViewHeaderBorderStyle enumeration. The other values of these enumerations use colors specified by the operating system. Additionally, when visual styles are enabled on Windows XP and above, the GridColor property value is not used. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903468"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.7.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Standard Border Styles&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Standard border styles are controlled via the CellBorderStyle, RowHeadersBorderStyle, and ColumnHeadersBorderStyle properties. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table identifies the standard border styles available via the :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 108.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;BorderStyle value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 351pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Fixed3D&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A   three-dimensional border.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;FixedSingle&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A   single-line border.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;None&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;No   border.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc116373116"&gt;&lt;/a&gt;&lt;a name="_Toc119903469"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.7.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Advanced Border Styles&lt;/span&gt;&lt;/a&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;The DataGridView control allows you to fully customize its appearance, including the borders of the cells and headers. The DataGridView has CellBorderStyle, ColumnHeadersBorderStyle, and RowHeadersBorderStyle properties that allow you to set the appearance of the cell border. However, if you need to further customize the borders, the DataGridViewAdvancedBorderStyle class allows you to set the style of the border on the individual sides of the cells. The Left, Right, Top, and Bottom properties of DataGridViewAdvancedBorderStyle represent the left, right, top, and bottom border of a cell, respectively. You can set these properties on the AdvancedCellBorderStyle, AdvancedColumnHeadersBorderStyle, AdvancedRowHeadersBorderStyle properties of the DataGridView to produce various appearances for the borders between the cells.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;The following table identifies the advanced border styles available that can be set for the left, right, top and bottom parts. Note that some combinations are not valid.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 108.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;BorderStyle   value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 351pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Inset&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A three-dimensional border.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;InsetDouble&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A single-line border.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;None&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;No border.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;NotSet&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The border is not set&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Outset&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A single-line raised border&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;OutsetDouble&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A double-line raised border&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;OutsetPartial&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A single-line border containing a raised portion&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Single&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;A single-line border&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;span style=""&gt;&lt;/span&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;span style=""&gt;&lt;a name="_Toc119903470"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.8&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Enter-Edit modes&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;By default, users can edit the contents of the current DataGridView text box cell by typing in it or pressing F2. This puts the cell in edit mode if all of the following conditions are met:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-family: Arial;"&gt;The &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;underlying&lt;/span&gt;&lt;span style="font-family: Arial;"&gt; data source supports      editing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The      DataGridView control is enabled. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The      EditMode property value is not EditProgrammatically. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The      ReadOnly properties of the cell, row, column, and control are all set to      false. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;In edit mode, the user can change the cell value and press ENTER to commit the change or ESC to revert the cell to its original value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can configure a DataGridView control so that a cell enters edit mode as soon as it becomes the current cell. The behavior of the ENTER and ESC keys is unchanged in this case, but the cell remains in edit mode after the value is committed or reverted. You can also configure the control so that cells enter edit mode only when users type in the cell or only when users press F2. Finally, you can prevent cells from entering edit mode except when you call the BeginEdit method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following table describes the different edit modes available:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 108.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center; page-break-after: avoid;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EditMode value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 351pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center; page-break-after: avoid;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EditOnEnter&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Editing   begins when the cell receives focus. This mode is useful when pressing the   TAB key to enter values across a row, or when pressing the ENTER key to enter   values down a column. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EditOnF2&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Editing   begins when F2 is pressed while the cell has focus. This mode places the   selection point at the end of the cell contents. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EditOnKeystroke&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Editing   begins when any alphanumeric key is pressed while the cell has focus. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EditOnKeystrokeOrF2&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Editing   begins when any alphanumeric key or F2 is pressed while the cell has focus. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 108.05pt;" width="144"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EditProgrammatically&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 351pt;" width="468"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Editing   begins only when the BeginEdit method is called. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903471"&gt;&lt;/a&gt;&lt;a name="_Toc116373117"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.9&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Clipboard copy modes&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When you enable cell copying, you make the data in your DataGridView control easily accessible to other applications through the Clipboard. The DataGridView control copies the text representation of each selected cell to the Clipboard. This value is the cell value converted to a string or, for image cells, the value of the Description property. The content is then added to the Clipboard as tab-delimited text values for pasting into applications like Notepad and Excel, and as an HTML-formatted table for pasting into applications like Word. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;You can configure cell copying to copy cell values only, to include row and column header text in the Clipboard data, or to include header text only when users select entire rows or columns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;The following table identifies the different clipboard copy modes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 155.1pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Clipboard Copy modes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 303.9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="405"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 155.1pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Disable&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 303.9pt;" width="405"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Copying   to the Clipboard is disabled. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 155.1pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EnableAlwaysIncludeHeaderText&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 303.9pt;" width="405"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The text   values of selected cells can be copied to the Clipboard. Header text is   included for rows and columns that contain selected cells. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 155.1pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EnableWithAutoHeaderText&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 303.9pt;" width="405"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The text   values of selected cells can be copied to the Clipboard. Row or column header   text is included for rows or columns that contain selected cells only when   the SelectionMode property is set to RowHeaderSelect or ColumnHeaderSelect   and at least one header is selected. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 155.1pt;" width="207"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;EnableWithoutHeaderText&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 303.9pt;" width="405"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;The text   values of selected cells can be copied to the Clipboard. Header text is not   included. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Depending on the selection mode, users can select multiple disconnected groups of cells. When a user copies cells to the Clipboard, rows and columns with no selected cells are not copied. All other rows or columns become rows and columns in the table of data copied to the Clipboard. Unselected cells in these rows or columns are copied as blank placeholders to the Clipboard.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When users copy content, the DataGridView control adds a DataObject to the Clipboard. This data object is retrieved from the GetClipboardContent() method. You can call this method when you want to programmatically add the data object to the Clipboard. The GetClipboardContent() method retrieves values for individual cells by calling the DataGridViewCell.GetClipboardContent() method. You can override either or both of these methods in derived classes to customize the layout of copied cells or to support additional data formats.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903472"&gt;&lt;/a&gt;&lt;a name="_Toc116373118"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.10&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Frozen columns/rows&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;When users view data sometimes they need to refer to a single column or set of columns frequently. For example, when displaying a table of customer information that contains many columns, it is useful to display the customer name at all times while enabling other columns to scroll outside the visible region. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;To achieve this behavior, you can freeze columns in the control. This is done via setting the Frozen property on the column or row. When you freeze a column, all the columns to its left (or to its right in right-to-left language scripts) are frozen as well. Frozen columns remain in place while all other columns can scroll. Rows act in similar fashion: all rows before the frozen row are frozen as well and remain in place while the non frozen rows can scroll. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903473"&gt;&lt;/a&gt;&lt;a name="_Toc116373119"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.11&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Implementing Custom cells and editing controls/cells&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;You can implement the IDataGridViewEditingCell interface in your derived cell class to create a cell type that has editing functionality but does not host a control in editing mode. To create a control that you can host in a cell in editing mode, you can implement the IDataGridViewEditingControl interface in a class derived from Control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903474"&gt;&lt;/a&gt;&lt;a name="_Toc116373120"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.11.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;IDataGridViewEditingControl&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Cells that support advanced editing functionality typically use a hosted control that is derived from a Windows Forms control. This interface is implemented by editing controls, such as DataGridViewComboBoxEditingControl and DataGridViewTextBoxEditingControl, that are hosted by the corresponding DataGridView cells, such as DataGridViewComboBoxCell and DataGridViewTextBoxCell, when they are in edit mode. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Cell types that can that host editing controls set their EditType property to a Type representing the editing control type.&lt;i style=""&gt;&lt;u&gt;&lt;span style="color: red;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903475"&gt;&lt;/a&gt;&lt;a name="_Toc116373121"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.11.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;IDataGridViewEditingCell&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;This interface is implemented by classes to provide a user interface (UI) for specifying values without hosting an editing control. The UI in this case is displayed regardless of whether the cell is in edit mode. The DataGridViewCheckBoxCell is an example of a cell that implements the IDataGridViewEditingCell interface. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;Other cell types, such as DataGridViewButtonCell, provide a UI but do not store user-specified values. In this case, the cell type does not implement IDataGridViewEditingCell or host an editing control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h2 style="margin-left: 0in;"&gt;&lt;a name="_Toc119903476"&gt;&lt;/a&gt;&lt;a name="_Toc116373122"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.12&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Virtual mode&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;With virtual mode, you can manage the interaction between the DataGridView control and a custom data cache. To implement virtual mode, set the VirtualMode property to true and handle one or more of the events described in this topic. You will typically handle at least the CellValueNeeded event, which enables the control look up values in the data cache. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903477"&gt;&lt;/a&gt;&lt;a name="_Toc116373123"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.12.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Bound Mode and Virtual Mode&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Virtual mode is necessary only when you need to supplement or replace bound mode. In bound mode, you set the DataSource property and the control automatically loads the data from the specified source and submits user changes back to it. You can control which of the bound columns are displayed, and the data source itself typically handles operations such as sorting. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903478"&gt;&lt;/a&gt;&lt;a name="_Toc116373124"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.12.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Supplementing Bound Mode&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;You can supplement bound mode by displaying unbound columns along with the bound columns. This is sometimes called "mixed mode" and is useful for displaying things like calculated values or user-interface (UI) controls. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Because unbound columns are outside the data source, they are ignored by the data source's sorting operations. Therefore, when you enable sorting in mixed mode, you must manage the unbound data in a local cache and implement virtual mode to let the DataGridView control interact with it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: double none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1.5pt medium medium; padding: 1pt 0in 0in;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; margin: 13pt 0in 6pt; padding: 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Common questions and scenarios&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;1)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_show%20unbound%20data%20along%20wi"&gt;&lt;span style=""&gt;How do I show unbound data along with bound data?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style=""&gt;2)&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: Arial;"&gt;&lt;a href="#_How_do_I_show%20data%20that%20comes%20from%20"&gt;&lt;span style=""&gt;How do I show data that comes from two tables?&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border-style: none none double; border-color: -moz-use-text-color -moz-use-text-color windowtext; border-width: medium medium 1.5pt; padding: 0in 0in 1pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903479"&gt;&lt;/a&gt;&lt;a name="_Toc116373125"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.12.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Replacing Bound Mode&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If bound mode does not meet your performance needs, you can manage all your data in a custom cache through virtual-mode event handlers. For example, you can use virtual mode to implement a just-in-time data loading mechanism that retrieves only as much data from a networked database as is necessary for optimal performance. This scenario is particularly useful when working with large amounts of data over a slow network connection or with client machines that have a limited amount of RAM or storage space. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;h3 style="margin-left: 0in; text-indent: 0in;"&gt;&lt;a name="_Toc119903480"&gt;&lt;/a&gt;&lt;a name="_Toc116373126"&gt;&lt;span style=""&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;5.12.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Virtual-Mode Events&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;If your data is read-only, the CellValueNeeded event may be the only event you will need to handle. Additional virtual-mode events let you enable specific functionality like user edits, row addition and deletion, and row-level transactions. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;Some standard DataGridView events (such as events that occur when users add or delete rows, or when cell values are edited, parsed, validated, or formatted) are useful in virtual mode, as well. You can also handle events that let you maintain values not typically stored in a bound data source, such as cell ToolTip text, cell and row error text, cell and row shortcut menu data, and row height data. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=""&gt;The following events occur only when the VirtualMode property is set to true.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: 4.5pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid rgb(153, 153, 153); padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 103.05pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="137"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Event &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: rgb(153, 153, 153) rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 4.5pt; background: rgb(223, 223, 223) none repeat scroll 0% 0%; width: 319.45pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="426"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Description &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 103.05pt;" width="137"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;CellValueNeeded&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 319.45pt;" width="426"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used by   the control to retrieve a cell value from the data cache for display. This   event occurs only for cells in unbound columns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153); border-width: medium 1pt 1pt; padding: 0in 4.5pt; width: 103.05pt;" width="137"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;CellValuePushed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color rgb(153, 153, 153) rgb(153, 153, 153) -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 4.5pt; width: 319.45pt;" width="426"&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Used by   the control to commit user input for a cell to the data cache. This event   occurs only for cells in unbound columns. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin: 5pt 0in;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;Call the   UpdateCellValue method when changing a cached value outside of a &lt;b&gt;CellValuePushed&lt;/b&gt;   event handler to ensure that the current value is displayed in the control   and to apply any automatic sizing modes currently in effect. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt
