473,396 Members | 1,804 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,396 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 8880
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...
0
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
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,...

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.