473,426 Members | 4,297 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,426 software developers and data experts.

DataGridView Readonly on Cell or Row ignored?

Hi

I'm feeling like a total idiot at the moment. We're building an app in
..NET 2.0 beta 2, and no matter how hard I try, I can't get a
DataGridView to accept ReadOnly = true on a cell or row.

Columns work fine, and stepping through the code clearly shows that
e.g. myDataGridView.Rows[0].ReadOnly = true; is being called, and yet
the row is definitely not read only.

Any ideas? Is this something missing in Beta 2, or am I missing some
simple step?

Many thanks,
Ben Gracewood.

Aug 26 '05 #1
2 8882
Hi
I'm feeling like a total idiot at the moment. We're building an app in
.NET 2.0 beta 2, and no matter how hard I try, I can't get a
DataGridView to accept ReadOnly = true on a cell or row.


I don't use .NET 2.0, but it seems like DataGridView is similar to .NET
1.1 DataView - try setting 'AllowEdit' property to 'false'. It locks all
the view not a single row however...

Cheers,
Piotrek

Aug 26 '05 #2
OK, I've found the problem.
Despite the fact that the Row in question is accessible in the OnLoad
event of the Form, setting the ReadOnly property doesn't 'stick'.

If you set readonly at a later time (e.g. when the DataGridView gets
focus) works OK.

I think this must be a bug, because the DataGridView.Rows[0] should
really return an index out of bounds error if the Row[0] is not ready
to be configured.

Aug 26 '05 #3

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

Similar topics

4
by: Aaron Smith | last post by:
Ok, this is an odd one, but I could use some assistance with the framework 2 in VB.Net... I want to have a DataGridViewColumn, only have it use the ComboBox, then when they drop down the...
3
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...
2
by: Ben Gracewood | last post by:
Hi I'm feeling like a total idiot at the moment. We're building an app in ..NET 2.0 beta 2, and no matter how hard I try, I can't get a DataGridView to accept ReadOnly = true on a cell or row....
10
by: rob | last post by:
I have a class that among others exposes a string property "Date". The date in this property is stored in the form yyyymmdd. Now I do the following 1) Generate a DataGridViewTextBoxColumn column...
8
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...
3
by: Daniel Manes | last post by:
I need a strategy to debug this situation... I can't put all the code involved, but here are some of the critical lines with comments: ------------------------- Private _parentDataCell As...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
1
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")...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
1
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...
0
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...
0
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...
0
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...

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.