473,799 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGridView: Skip ReadOnly cells

I have a DataGridView with some read-only cells.
I want it skips these cells when the user press Tab or Shift+Tab keys.
How can I do this?

Thanks.

Junior.

Oct 4 '06 #1
1 6040
Junior,

You will have to handle the tabbing for the grid, most likely overriding
the ProcessTabKey method on the grid. You will have to determine which
direction to proceed (what if the ALT key is pressed as well, you need to
tab backwards).

I would look at reflector to look at the ProcessTabKey method, and also
the TabToNextCell and TabToPreviousCe ll methods for guidance on how to find
the next cell. It's not a simple task, but it does look doable.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"osmarjunio r" <os*********@gm ail.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
>I have a DataGridView with some read-only cells.
I want it skips these cells when the user press Tab or Shift+Tab keys.
How can I do this?

Thanks.

Junior.

Oct 4 '06 #2

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

Similar topics

8
34305
by: George | last post by:
Hi, I have been trying to see if I can do the following: 1. Create a DataGridView 2. Create 2 columns in the DataGridView (1 textbox and the other combobox) 3. Create a DataTable containing my data. (AutoGenerateColumns is true). The data is 2 columns of System.String cell. 4. If I assign the DataTable to DataGridView.DataSource, I get 4 columns. 2
0
1421
by: osmarjunior | last post by:
I'm trying to implement this, but without success. What I want is when the user press Tab key in my DataGridView, automatically jump to the next cell, but if the next cell is read only, then jump to the next, and so on. How can I achieve this? Regards.
0
1039
by: TonyJ | last post by:
Hello! I have earlier used a grid called flygrid where everything had to be done by coding. I use VS2005 so I have this DataGridView which I can't really understand how to use. I mean what can be done by using different feature like add column/edit column and so and
1
4688
by: =?Utf-8?B?Q2hyaXN0aWFuIEhhdmVs?= | last post by:
Hi, I have an DataGridView control with the following columns (added using the designer): column1 - DataGridViewTextBoxColumn column2 - DataGridViewComboBoxColumn (values "test1", "test2") column3 - DataGridViewCheckBoxColumn How can I add a row, that the item "test2" is selected ("column2")? How can I set a cell to readonly?
12
13649
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 display in a textbox below the datgridview. I currently have it fixed so if you click on a row the note field from that row is put in the textbox. I'd like this to be automatic as they move through rows. Also the note field is one of two fields...
2
7170
by: Rosco | last post by:
Hello, Quick Overview: I am creating a Windows application using C# and have run across a problem. I’m trying to use a DataGridView in “Bound” mode, but filter the view. I have a database table full of employees called Employees. I wish to display the First Name, Last Name, Employee Id and Social Security Number (SSN) of all employees who have illegitimate social security numbers. Due to the SSN validity check required, I cannot simply...
3
2825
by: Christian | last post by:
Hi, i create aprogram that load a table from Access DB. i want color rows with different color but when i run the program and i load the datagridview the first time, the rows are white! only when i insert a new record the rows change color, why? thanks to all! bye
1
2779
by: mzahid | last post by:
Hellow All I am new in ASP.Net Application. I have a page with some TextBoxes and GridView. I have Done the Values of Textboxes save into Invoice Table and i want to save Invoice Detail values through DataGridView, But the DataGridView behave readonly. In Windows Application form i can write in DataGridView (As many Record) and click save Botton then textboxes value save in Invoice table & DataGrid Values save in Invoice Detail Table. using...
6
10645
by: Ciaran | last post by:
I'm having a really strange issue with the DataGridView control in a VS2008 / .NET 3.5 winforms project. I have a simple form with a grid. In the form constructor I call a function to bind the grind to a DataTable, and then loop through the rows setting the background colour of the last cell to LightGrey and the cell itself to read-only if the column value is true. After the form finishes loading the code didn't work i.e. the cells are not set...
0
9686
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
10475
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...
1
10222
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
10026
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
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.