<?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-4059007728240251021</id><updated>2011-04-21T17:14:42.387-07:00</updated><title type='text'>Problem data grid view vb2005</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://problemdatagridview.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059007728240251021/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://problemdatagridview.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-4059007728240251021.post-1101610220969905988</id><published>2009-02-04T03:04:00.001-08:00</published><updated>2009-02-04T03:04:42.395-08:00</updated><title type='text'></title><content type='html'>Problem with datagridview and checkboxcolumn. vb 2005&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have a form with a datagridview on it. This datagridview is used to display saved tests. When the user clicks a saved test a dialog box is displayed to display certain details of the saved test. The details are displayed in a datagrid view on the dialog box. The datagridview has a checkboxcolumn that was added through the datagridview tasks wizard. Two additional columns are bound to a dataset during the dialog box load event. I add a check mark to each check box with &lt;br /&gt;&lt;br /&gt;Dim r As System.Windows.Forms.DataGridViewRow &lt;br /&gt;With Me.DataGridView1 &lt;br /&gt;    For Each r in .Rows &lt;br /&gt;    r.Cells("Column1").Value = 1 &lt;br /&gt;    Next &lt;br /&gt;End With &lt;br /&gt;&lt;br /&gt;Everything works great the first time that the dialog box is displayed. The value for each check box cell is 1. However, if I close the dialog box and then reopen it the check boxes do not get checked and there is no value for the check box cells. &lt;br /&gt;&lt;br /&gt;I created a button to run the code above and this will check the check boxes if the button is clicked, but if I click the button programatically nothing happens. &lt;br /&gt;&lt;br /&gt;Has anyone else experienced this? &lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;code&lt;br /&gt;&lt;br /&gt;I think the problem was coming from having bound and unbound columns. I am now adding the data with a For Next loop and everything works corectly. &lt;br /&gt;&lt;br /&gt;Me.DataGridView1.Rows.Clear() &lt;br /&gt;&lt;br /&gt;Dim j as Integer &lt;br /&gt;Try &lt;br /&gt;   For j = 0 To dsLeakAreas.Tables(0).Rows.Count - 1 &lt;br /&gt;      DataGridView1.Rows.Add() &lt;br /&gt;      DataGridView1.Item(0, j).Value = CheckState.Checked &lt;br /&gt;      DataGridView1.Item(1, j).Value = dsLeakAreas.Tables(0).Rows(j).Item("LeakLocation") &lt;br /&gt;      DataGridView1.Item(2, j).Value = dsLeakAreas.Tables(0).Rows(j).Item("Notes") &lt;br /&gt;   Next &lt;br /&gt;Catch ex As Exception &lt;br /&gt;  Throw New Exception(ex.message) &lt;br /&gt;End Try&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Edited by - gjc on 4/28/2008 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source :http://www.vbcity.com&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;a href="http://gambarbergerak-riaq.blogspot.com"&gt;Trik Gambar Bergerak&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://gambar-dimouse.blogspot.com"&gt;Trik Gambar-dimouse&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://hapuspwdmysql.blogspot.com"&gt;Trik hapus pwd mysql&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://insertintodb.blogspot.com"&gt;Trik insertin to db&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://jadirootdilinux.blogspot.com"&gt;Trik jadi root dilinux&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://jam-distatus-bar.blogspot.com"&gt;Trik jam-distatus-bar&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://koneksi-kedatabase.blogspot.com"&gt;Trik Koneksi-ke database&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://koneksi-msql-php.blogspot.com"&gt;Trik Koneksi-msql-php&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://lihat-database-mysql.blogspot.com"&gt;Trik lihat-database-mysql&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://membahas-fungsi-else.blogspot.com"&gt;Trik membahas-fungsi-else&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://member-area-riaq.blogspot.com"&gt;Trik member-area&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=woodworkin09c-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=B000FI73MA&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt; &lt;iframe src="http://rcm.amazon.com/e/cm?t=woodworkin09c-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=B000P9ZBFA&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4059007728240251021-1101610220969905988?l=problemdatagridview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemdatagridview.blogspot.com/feeds/1101610220969905988/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://problemdatagridview.blogspot.com/2009/02/problem-with-datagridview-and.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4059007728240251021/posts/default/1101610220969905988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4059007728240251021/posts/default/1101610220969905988'/><link rel='alternate' type='text/html' href='http://problemdatagridview.blogspot.com/2009/02/problem-with-datagridview-and.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>
