Has anybody found a way to disable a column in DataGridView i.e prevent it
being selected. With DataGrid it was fairly easy to check on the column being
entered and move the selection to the next column, this does not seem
possible with DataGridView. 2 13382
Handle the DataGridView.Co lumnStateChange d event. The event passes an
instance of DataGridViewcol umnStateChanged EventArgs, which includes a
reference to the Column, as well as the type of state that has changed. You
can then set the Selected property of the Column to false.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Show me your certification without works,
and I'll show my certification
*by* my works.
"tony lock" <to******@discu ssions.microsof t.com> wrote in message
news:26******** *************** ***********@mic rosoft.com... Has anybody found a way to disable a column in DataGridView i.e prevent it being selected. With DataGrid it was fairly easy to check on the column being entered and move the selection to the next column, this does not seem possible with DataGridView.
Thanks had to use CellStateChange d to avoid selection of individual cells,
but that worked perfectly.
"Kevin Spencer" wrote: Handle the DataGridView.Co lumnStateChange d event. The event passes an instance of DataGridViewcol umnStateChanged EventArgs, which includes a reference to the Column, as well as the type of state that has changed. You can then set the Selected property of the Column to false.
-- HTH,
Kevin Spencer Microsoft MVP Professional Numbskull
Show me your certification without works, and I'll show my certification *by* my works.
"tony lock" <to******@discu ssions.microsof t.com> wrote in message news:26******** *************** ***********@mic rosoft.com... Has anybody found a way to disable a column in DataGridView i.e prevent it being selected. With DataGrid it was fairly easy to check on the column being entered and move the selection to the next column, this does not seem possible with DataGridView. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David Veeneman |
last post by:
How can I set a bound DataGridView control to use a dataset table's column
captions, instead of column names?
I'm working with a DataGridView control, which I have bound to a table in a
dataset. The dataset is created at run time, so I don't know column headers
in advance. The table's column captions are set at run time, using the
DataColumn.Caption property. The table is bound to the grid using the grid's
DataSource property. Here is my...
|
by: Rich |
last post by:
Hello,
I am reading data from a sql server table that is under replication. This
table has the replicatin GUID column that is generated with replicatin. I am
reading the data from a dataAdapter/Dataset using a dataview which is the
data source for a datagridview control. When I scroll horizontally in the
datagridview control and reach this GUID column (which is not at the end of
the table) it raises the datagridview dataError event. ...
|
by: Marc Solé |
last post by:
Hello,
I want to insert an image to a specific column of a dataGridWiew. I explain
what I'm doing:
- I define the ColumnType as a DataGridViewImageColumn.
- I select the image (an icon of open folder).
When I accept, in the design form, appears in the ImageColumn the typical
red cross of an image not found.
|
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
|
by: Matt |
last post by:
I have been searching all over the web for a way to sort a DataGridView based on
the actual text being shown in a ComboBox column as opposed to the underlying
value (an ID in this case). Can anyone tell me if this is even possible, and if
so, how to do it? If this is completely impossible, how would you suggest going
about sorting a ComboBox wherein the text displayed in the column is the
client's name, and the underlying value is an ID?
...
| |
by: sklett |
last post by:
I'm changing from a DataGrid to a DataGridView and have run across a
problem. The items that are bound to the DataGrid have an int Property that
represents a primary key of a lookup table in my database. For example:
table JobTypes
1 | Manager
2 | Controller
3 | Supervisor
table Employee
|
by: Nick |
last post by:
hi all:
the one of the column of gridview got multiple line data to be shown , so
how do i deal with it? what i am thinking about is using template field
instead of the boundfield. is that other solution out there?
Cheers
Nick
|
by: mahesh.nimbalkar |
last post by:
I want to use Multi column sorting in DataGridView. The scenario is
like this:
1) DataGridView has two columns; Id and name
2) User clicks on Id column and DataGridView is sorted ascending
3) User clicks on Id column and DataGridView is sorted descendin
Now, when user clicks on name column, the DataGridView should be
sorted as Id desc and name asc.
|
by: priyamtheone |
last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have:
1) Initially all the cells of the dtp column should be blank unless they are filled by the user.
2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
|
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...
|
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,...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |