473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Selecting a new cell in a DataGridView

Dom
I posted this before, no takers. Trying again.

Is there anyway to cancel the selection of a new cell in a
DataGridView? For example, if the user selects a cell with the
control key down, then I don't want the selection to change.

Dom
Feb 14 '08 #1
2 1457
Dom
Well, I decided to answer this question myself, since none of you
lunkheads seems to know how to do this.

I created MyDataGridView, which extends DataGridView and overrides the
OnMouseDown event handler. This new handler fires off two events,
MouseDownPrep and base.OnMouseDown, but the second event only fires if
the result of the first event okays it.

I guess that's the only way.

Dom

On Feb 14, 9:59*am, Dom <dolivas...@gmail.comwrote:
I posted this before, no takers. *Trying again.

Is there anyway to cancel the selection of a new cell in a
DataGridView? *For example, if the user selects a cell with the
control key down, then I don't want the selection to change.

Dom
Feb 17 '08 #2
There's nothing that makes people here want to help you more than being
insulted.

RobinS.
---------------------------------------------
"Dom" <do********@gmail.comwrote in message
news:de**********************************@q78g2000 hsh.googlegroups.com...
Well, I decided to answer this question myself, since none of you
lunkheads seems to know how to do this.

I created MyDataGridView, which extends DataGridView and overrides the
OnMouseDown event handler. This new handler fires off two events,
MouseDownPrep and base.OnMouseDown, but the second event only fires if
the result of the first event okays it.

I guess that's the only way.

Dom

On Feb 14, 9:59 am, Dom <dolivas...@gmail.comwrote:
I posted this before, no takers. Trying again.

Is there anyway to cancel the selection of a new cell in a
DataGridView? For example, if the user selects a cell with the
control key down, then I don't want the selection to change.

Dom
Feb 18 '08 #3

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

Similar topics

3
by: Rich | last post by:
Hello, If I want to update data displayed in a datagrideview/datagridview cell, how can I determine what cell I am updating? I am looking at the click event below, for example. Can I get...
2
by: Bob | last post by:
How do I show a calendar control or another appropriate control to pick a date and time for a cell in a column in a datagridview? Thanks for any help. Bob
10
by: steve | last post by:
Hi All I would like to be able to change the cell borders on certain cells to none at runtime to make a group of cells appear to be merged I have tried the following in the cellformatting...
2
by: galletg | last post by:
please; how to write by code in a datagrid view cell a text in a textbox. thank you for your help. georges gallet
1
by: Dranizz | last post by:
I want to set the value of a cell in a datagridview. DatagridView.CurrentRow.Cells(CEllName).value = "Blabla" When I do this in code and when it's the first cell I edit in a new row, it does...
0
by: =?Utf-8?B?UmljaA==?= | last post by:
In a datagridview, the first column header cell is columnHeader(0), which is immediately to the right of the Top Left Corner Select All cell. And the first RowHeader cell is RowHeaderCell(0) which...
1
by: zacks | last post by:
Using VS 2005. I have an app that has a DataGridView control. This control has two columns, the first column is a standard TextBox, and the second column is a CheckBox. I am having difficulty...
12
by: cj | last post by:
When viewing a datatable in a datagridview one of the columns in it is a "note" field which can be quite long. I would like to have the note field of the currently selected row of the datagrid...
1
by: Andrus | last post by:
I have Text box controls and DataGridView control in WinForms form. DataGridview contains custom ComboBox columns and standard TextBox columns. Edit mode is EditOnEnter. When focus is moved...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.