Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an editable column in a DataGrid

Status
Not open for further replies.

RexHeadlong

Programmer
Apr 10, 2002
35
US
I'm trying to create a read/write column in a DataGrid.
I bound my DataGrid.DataSource to my DataTable.DefaultView. I created my DataGridColumnStyles and added them to a DataGridTableStyle, which I then added to my DataGrid's TableStyles collection.

After all is said and done, I've verified that:

((DataView)myDataGrid.DataSource).AllowEdit = true
myDataGrid.TableStyles[0].ReadOnly = false
myDataGrid.TableStyles[0].GridColumnStyles["myColumn"].ReadOnly = false

And, I even explicitly set this:
myDataGrid.DataSource.DataTable.Columns[0].ReadOnly = false;

BUT, when I run the app, I click in my supposedly editable column, but I can't change the value in there.

Does anybody have an idea what's going wrong?

Thanks for any help.
 
Duh.

I just realized that the DataGrid itself has a ReadOnly property.

Never mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top