DataGridBoolColumn inaccessable

B

B.J. Raiford

I have a DataGrid on a form in my application that is bound to an xml file
and I have set the table style to contain a few columns with one editable
one, a DataGridBoolColumn.

I set DataGrid.ReadOnly to True and the DataGridBoolColumn.ReadOnly to false
but I still cannot access the check box. When I click on the box nothing
happens.

If I set DataGrid.ReadOnly to True then I get the option to add a new line
on the grid, which I don't want, and the cell with the checkbox in it acts
very strange. By strange I mean that selecting the checkbox takes a couple
of steps, you have to select the cell then you are allowed to select the
checkbox.

How can I get the column to show the checkbox and have it selectable, but
not have the new entry row show up and not have the rest of the grid
editable.

Thanks,

B.J.
 
C

Chris, Master of All Things Insignificant

The only way I know how to do what you want is to use a DataView. Then I
think you'd have to load the xml into a DataTable, set the DataTable to a
DataView, then bind it to the DataGrid. Set teh DataView.AllowNew property
to be false. This willl stop the new row from showing up and you don't have
to change the DataGrid.ReadOnly property. Just set all the
DataGridColumns.ReadOnly to true except the ones you wanted. That's how I
did it.

Good Luck
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top