473,663 Members | 2,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to handle editing in DataGridView when SelectionMode = FullRowSelect?

bob
I'm using the DataGridView control, with EditMode set to "edit
programatically " and SelectionMode set to "FullRowSel ect" (or something
like that). My program allows the User to go into edit mode by
double-clicking a row, or pressing F2, or selecting a menu item
(Row/Edit). When that happens, I turn SelectionMode into "CellSelect "
(or something like that) -- otherwise, the User can't see what he is
editing too well. Ok, now the User edits the data in the current row.
When he's done, he either presses Escape to exit EditMode, or moves to
a new row. If he moves to a new row, I trap that in the "LeaveRow"
event, and turn off EditMode and turn the SelectionMode back to
FullRowSelect.

Problem: When EditMode ends (either by the User pressing Escape, or my
program turning it off programatically ) I set SelectionMode back to
FullRowSelect. But the full row isn't fully selected immediately, only
the current cell is. It takes the User moving to another row or two
before the full row is "selected" again, or at least shows that it is
"selected" (by highlighting the entire row).

How can I force the full (new current) row to be hightlighted
immediately, as soon as I turn SelectionMode back to
"FullRowSelect" ????

Thanks!

Jun 20 '06 #1
0 2319

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

Similar topics

3
10430
by: David | last post by:
I was looking at this article, but it doesn't work for me. http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.multiselect.aspx I can not select multiple rows in my datagridview. Any ideas? Thanks, David
2
18060
by: Spencer Williamson | last post by:
Anyone know how to force the row to select when user right clicks the grid? I have SelectionMode set to DataGridViewSelectionMode.FullRowSelect. I tried this... Private Sub DataGridView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseDown If e.Button = Windows.Forms.MouseButtons.Right Then Dim mouseArg As New
4
4757
by: steve | last post by:
Hi All I have a datagridview bound to a datatable Due to the use of touch screens I need to be able to scroll the grid in code in response to a button click i.e each button touch (click) will move the selection up 1 row How do I do that
2
10697
by: plmanikandan | last post by:
Hi, I am using .net framework2.0,Visual Studio 2005.I need to bind the hash table to datagridview.Is it possible I am having class Person class person { public int no; public string name; }
1
7907
by: mike | last post by:
I have a datagridview control and a button on the windows form. I am adding a new row in button click event. When the number of rows grow, the newly added row will not be visible but a scroll bar will be shown. I want the program to highlight the newly added row and make it visible in the datagridview by scrolling to that position when a new row was added by button click event. How can you do that? Thanks in advance.
3
5448
by: M K | last post by:
My dg is loaded (from stored procedure) and has 1 record in it. When I press enter on that row it does nothing (I have a breakpoint just inside the code where i check for enter pressed) if (e.KeyData == Keys.Enter) It never goes into that event. For the DataGridView I have: ReadOnly = false
1
1394
by: mynkow | last post by:
Hi, I have a simple problem. I have a DataGridView populated from dataSet. I want to change the type of one of the columns from text to combo. All cells in that column will contain same data. dgwEmployersList.DataSource = Employee.getAllEmployers(); dgwEmployersList.DataMember = "employer"; dgwEmployersList.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgwEmployersList.MultiSelect = false;...
5
1380
by: shehezada | last post by:
Hi there, I have a DataGridView on a Windows Form. The form load event looks like this private void Form1_Load(object sender, EventArgs e) { MyCollection mycoll=new MyCollection(); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView1.AutoGenerateColumns = false; BindingSource bs = new BindingSource(); bs.DataSource = mycoll.GetRecords(1); dataGridView1.DataSource = bs;
20
20307
by: Phil | last post by:
VB2008 I have a DataGridView with MultiSelect = True and SelectionMode=FullRowSelect. 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.SelectedRows row.Cells("MyCheckboxColumn").Value = False Next
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
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...
0
8634
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...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4182
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
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1757
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.