By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Readonly Column in a DataGrid... not working!

P: n/a
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("BoolCol",
System.Type.GetType("System.Boolean"))
dc.DefaultValue = False
dc.ReadOnly = False
ds.Tables("Archive").Columns.Add(dc)

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

boolCol = New DataGridBoolColumn
With boolCol
.MappingName = "BoolCol"
.Width = 20
.AllowNull = False
.ReadOnly = False
End With
ts1.GridColumnStyles.Add(boolCol)
boolCol = Nothing
DataGrid1.TableStyles.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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.