473,756 Members | 3,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagridview doesn't update current row values

VB2008
I have a DataGridView with MultiSelect = True and
SelectionMode=F ullRowSelect. One of the columns is a checkbox column. I have
a function that goes through all the selected rows and sets the value of
this column.

For Each row In DataGridView1.S electedRows
row.Cells("MyCh eckboxColumn"). Value = False
Next

This seems to almost work, but I noticed that sometimes it does not update
the first or the last selected row. On investigation, it seems that the
value is updated, but if the row happens to be the currentrow, the change is
not displayed until the currentrow is changed. I have managed to get around
this problem by setting CurrentCell = Nothing after I have made the changes,
but this has the undesirable side effect of clearing the selection.

Any suggestions?

TIA
Phil.

Jun 27 '08
20 20327
Hi Phil,

Thank you for your reply!
I wonder if this is because I have two columns both bound to the same
item? Only one of them has been changed, and this might cause some
confusion.

No, I don't think so. You may create a new WinForm application project to
perform a test on it, if you'd like to.
I am not too concerned, as my workaround seems OK for now.
Well, I consider I can close this issue in the newsgroup now. Do you agree
with me? If you have any concern, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 27 '08 #21

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1689
by: Wanda | last post by:
I am using vb.net and have a bounded datagrid by using SQLDataAdaptor and SQLDataSet, it does show the data when it is first loaded. But when I change the data on the datagrid, it doesn't update the database, even I use AcceptChanges... What am I missing? What I am expecting is it should update the database automatically without doing it manually with the code. Please help!!!!
3
11776
by: thomasp | last post by:
I know this is a vague question, but I am not sure what information to give. I am using VB2005 beta and the datagridview is pulling data from one of three tables in an Access database. For some reason when I edit the feilds that I have not set as readonly, the changes do not get written to the database. I have the code that loads the datagridview posted below. Thanks for any suggestions. Thanks, Thomas
1
7729
by: JeremyGrand | last post by:
I've read what's available here, but can't seem to make this work right. I'm experimenting with components on a form, although I'd rather create the pieces & assemble them in code, but that's another issue entirely. I have a table in sql2k with an autoincrement column as primary index. It also has a changeDate column with a trigger that updates to current datetime when any column other than itself is changed. Made a new form, followed...
2
5019
by: Ivan | last post by:
I have a class Foo which have two property. I have a thread that do some process and update class Foo int B. I have a datagridview on main form. this datagridview data source to this class Foo and column A binds to string A and column B binds to int B. When i start two threads, the datagridview able to show two rows and updated int B at run time. How? public class Foo { public Foo()
7
10068
by: John J. Hughes II | last post by:
I have a DataGridView with a TextBoxColumn. I setting the data source to a List<stringvalue in a static class. The list is filled from a background thread. So far all is fine and it works great, at least on my system. The reason I am doing this is some customers are pulling from VPN connections which are slow. This allows the list of rows in the data grid to appear a little quicker while the list which are not used as soon load in...
1
8768
by: MFayaz | last post by:
Hello! I have to refresh datagridview when database update , IS there any way to solution that my datagridview auto refresh when any user update database. Thanks in Advance
7
2407
by: BONES7714 | last post by:
Hello, This is my first post to any sort of forum although I've used them to learn the very little Access/VBA that I know so please forgive my ignorance. I work for the National Guard as Combat Medic and I've been tasked with created a DB to track the location of other soldiers medical records and other various infomation. As such, I have a form where I can enter the barcode for a record into a textbox and have it added to a listbox and...
1
6453
by: bharathi228 | last post by:
hello sir, iam new to windows application.iam working with datagridview in vb.net .how to update the selected row in datagridview.any one help me with this.
0
9273
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9841
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9711
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5141
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5303
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.