471,072 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,072 software developers and data experts.

DataGridBoolColumn inaccessable

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.
Nov 21 '05 #1
1 1487
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
"B.J. Raiford" <bj********@hotmail.com> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
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.

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by cmelnick | last post: by
1 post views Thread by Erald Kulk | last post: by
4 posts views Thread by Ubi | last post: by
2 posts views Thread by James Goodman | last post: by
2 posts views Thread by nate axtell | last post: by
reply views Thread by Ryan Liu | last post: by
reply views Thread by Brett Romero | last post: by
reply views Thread by leo001 | last post: by

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.