<?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-5591857216791077492</id><updated>2012-02-16T12:51:51.211-08:00</updated><title type='text'>vb.net 2008</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vbnet-vbnetcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5591857216791077492/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vbnet-vbnetcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>vbnetcode</name><uri>http://www.blogger.com/profile/04926504053784281645</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>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5591857216791077492.post-8431491685697429032</id><published>2009-02-02T07:42:00.000-08:00</published><updated>2009-02-02T07:43:35.973-08:00</updated><title type='text'></title><content type='html'>IDE : VS 2005, Platform : .NET 2.0,&lt;br /&gt;BackColor DataGridView Columns&lt;br /&gt;I'm trying to set the backcolor of the columns of a datagridview based on the text entered into a textbox(txtPosit). First of all, this code works:&lt;br /&gt;Code: For Each column As DataGridViewColumn In Me.dgvMaster.Columns       If column.HeaderText = Me.txtPosit.Text Then                 column.DefaultCellStyle.BackColor = Color.LightGray       End If Next&lt;br /&gt;&lt;br /&gt;The problem I'm having is formatting multiple columns based on the text that is NOT the name of one of the columns (This is a program to filter positions of a baseball database). One of the filter options is "Middle", and when this is selected, I would like to set the backcolor of the 2B and SS columns in the datagridview. Here's what I thought would work:&lt;br /&gt;Code: If Me.txtPosit.Text = "Middle" Then&lt;br /&gt;            For Each column As DataGridViewColumn In Me.dgvMaster.Columns                 If column.HeaderText = "2B" Or column.HeaderText = "SS" Then                     column.DefaultCellStyle.BackColor = Color.LightGray                 End If             Next&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;This code provides no formatting to the columns. However, if I remove the outside IF/THEN statement, then the backcolor of both columns is changed no matter what text is entered in the textbox.&lt;br /&gt;Am I approaching this the wrong way, or am I missing something?&lt;br /&gt;Thanks for any help.&lt;br /&gt;Rick&lt;br /&gt;Edited by - rb72169 on 3/21/2008 5:34:33 AM&lt;br /&gt;source :http://www.vbcity.com&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;&lt;a href="&gt;http://gambarbergerak-riaq.blogspot.com"&gt;Trik&lt;/a&gt; Gambar Bergerak&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://gambar-dimouse.blogspot.com"&gt;Trik&lt;/a&gt; Gambar-dimouse&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://hapuspwdmysql.blogspot.com"&gt;Trik&lt;/a&gt; hapus pwd mysql&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://insertintodb.blogspot.com"&gt;Trik&lt;/a&gt; insertin to db&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://jadirootdilinux.blogspot.com"&gt;Trik&lt;/a&gt; jadi root dilinux&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://jam-distatus-bar.blogspot.com"&gt;Trik&lt;/a&gt; jam-distatus-bar&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://koneksi-kedatabase.blogspot.com"&gt;Trik&lt;/a&gt; Koneksi-ke database&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://koneksi-msql-php.blogspot.com"&gt;Trik&lt;/a&gt; Koneksi-msql-php&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://lihat-database-mysql.blogspot.com"&gt;Trik&lt;/a&gt; lihat-database-mysql&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://membahas-fungsi-else.blogspot.com"&gt;Trik&lt;/a&gt; membahas-fungsi-else&lt;/a&gt;&lt;br/&gt;&lt;a href="&lt;a href="&gt;http://member-area-riaq.blogspot.com"&gt;Trik&lt;/a&gt; member-area&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="&lt;a href=" t="woodworkin09c-20&amp;amp;o="1&amp;amp;p="8&amp;amp;l="as1&amp;amp;asins="B000FI73MA&amp;amp;fc1="000000&amp;amp;IS2="1&amp;amp;lt1="_blank&amp;amp;m="amazon&amp;amp;lc1="0000FF&amp;amp;bc1="000000&amp;amp;bg1="FFFFFF&amp;amp;f="ifr"&gt;http://rcm.amazon.com/e/cm?t=woodworkin09c-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as1&amp;amp;asins=B000FI73MA&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&lt;/a&gt;" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;iframe src="&lt;a href=" t="woodworkin09c-20&amp;amp;o="1&amp;amp;p="8&amp;amp;l="as1&amp;amp;asins="B000P9ZBFA&amp;amp;fc1="000000&amp;amp;IS2="1&amp;amp;lt1="_blank&amp;amp;m="amazon&amp;amp;lc1="0000FF&amp;amp;bc1="000000&amp;amp;bg1="FFFFFF&amp;amp;f="ifr"&gt;http://rcm.amazon.com/e/cm?t=woodworkin09c-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=as1&amp;amp;asins=B000P9ZBFA&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr&lt;/a&gt;" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5591857216791077492-8431491685697429032?l=vbnet-vbnetcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbnet-vbnetcode.blogspot.com/feeds/8431491685697429032/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://vbnet-vbnetcode.blogspot.com/2009/02/ide-vs-2005-platform.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5591857216791077492/posts/default/8431491685697429032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5591857216791077492/posts/default/8431491685697429032'/><link rel='alternate' type='text/html' href='http://vbnet-vbnetcode.blogspot.com/2009/02/ide-vs-2005-platform.html' title=''/><author><name>vbnetcode</name><uri>http://www.blogger.com/profile/04926504053784281645</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></feed>
