474,044 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Readonly Column in a DataGrid... not working!

I have a datagrid that has it's first column set to a checkbox column.
I need that column to be "checkable" , while all the others not
editable.

So I created columnstyles

First I add a boolean column to my dataset:

Dim dc As New DataColumn("Boo lCol",
System.Type.Get Type("System.Bo olean"))
dc.DefaultValue = False
dc.ReadOnly = False
ds.Tables("Arch ive").Columns.A dd(dc)

Elsewhere, I create the boolean column style. Here's a snippet:

boolCol = New DataGridBoolCol umn
With boolCol
.MappingName = "BoolCol"
.Width = 20
.AllowNull = False
.ReadOnly = False
End With
ts1.GridColumnS tyles.Add(boolC ol)
boolCol = Nothing
DataGrid1.Table Styles.Add(ts1)

I set ReadOnly=False for both the datacolumn and the column style. But
the datagrid keeps my checkbox column to be non-editable. I didn't
show the code, but I also have column styles for the other columns. I
have them set to ReadOnly = True. But if I change it to ReadOnly =
False, there is not difference. My code just isn't reading the
Readonly property.

Help anyone? Thanks so much!
John

Nov 21 '05 #1
0 1313

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

Similar topics

1
2552
by: Paulo Gon?alves via .NET 247 | last post by:
My datagrid has a big problem, it happens only in columns that are read only. Please see the picture at http://mega.ist.utl.pt/~pfrg/datagrid/datagrid_problem.jpg The gost that I show it?s like a new readonly textbox. If the selected cell it?s not readonly there?s no problem. I think that the problem it?s ralated with lose of focus of the datagrid. After pressing a button, I fill again the datagrid with new datasource but this thing...
2
1886
by: Learning SQL Server | last post by:
Forgive the repost, but this is really troublesome and I hope SOMEONE can shed some light on it. I am trying to update a datarow via in-place editing from a dataset stored in session. When I try to write the new value into the selected row, I always get the following error : Column is read-only. in my UpdateCommand event I have:
4
2079
by: Dany P. Wu | last post by:
Hi everyone, I'm not entirely sure if this is the best way of going about it, but here's the scenario.......... I have two datagrid, each bound to a datatable which have checkbox columns. There are two buttons between the datagrids, "Add" and "Remove". They basically remove rows from one grid to the other, only those with the checkbox ticked.
4
2537
by: Doug Bell | last post by:
Hi, I needed to make a TextBox on a DataGrid ReadOnly based on the condition of another cell on its row. I achieved this using a Custom Data Column Class "DacDGTextColLotNo" but I can't get the TextBox to display its value when you leave the TextBox. I figure that I need to use the SetColumnValueAtRow Method but I am struggling to understand how.
1
2414
by: Tricia Colwell via DotNetMonster.com | last post by:
Here is what i have: I have a datagrid with two columns one is a combo box style and the other is a textbox style. If the combo box is "Between" or "Like" i want that the next cell to be readonly..which is the textbox one. How do i do this??? Tricia --
5
2206
by: John Smith | last post by:
Is it possible to set DataGrid's ReadOnly property to True/False at runtime? An example: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn DataField="id" ReadOnly="True" HeaderText="ID"></asp:BoundColumn> </Columns> <asp:datagrid>
3
1869
by: Hamed | last post by:
Hello I have a DataGrid object in my ASP.NET page that has the following template column. When I put the "readonly" attribute in the INPUT tag, it generates readonly="". <asp:TemplateColumn HeaderText="Kg Price" HeaderStyle-Width="5%"> <ItemTemplate><INPUT class="ep" id=kf readOnly value='<%# DataBinder.Eval(Container, "DataItem.KgFee") %>' name=kf runat="server"></ItemTemplate>
1
1566
by: Mike G | last post by:
I have a datagrid that is editable by the user. Some of the columns are readonly and others can be edited. I have one column that I need to be able to make readonly based on the values of other columns, otherwise it remains editable. I want to set this property in the itemdatabound event as the datagrid is loaded. Below is my ItemDataBound routine to show what I'm trying to do. Everything else works; I just need to be able to conditionally...
7
1616
by: RolfHerbert | last post by:
Hi all, Source code below. I am using an sqldatasorce to populate a datagrid. I am using datakeyIds. I am interested in two keys which I have added to the datakeyids, however if either of the keys is not databound, set to visible=false or readonly=true, they are unavailable as parameters in my update statement.
0
12137
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
12020
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
11139
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...
1
8696
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 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...
0
6652
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
6836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5413
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
4943
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3970
bsmnconsultancy
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...

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.