470,562 Members | 2,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,562 developers. It's quick & easy.

DataGrid & DataView & DataGridTableStyle

Rxd
I have a Datagrid that should have a couple of hidden columns. I used a
DataGridTableStyle to hide the columns and it was working fine except I needed
to prevent the DataGrid from allowing new rows to be added. I was told to use a
DataView and set AddNew to false (thanks for the info btw) but now I can't use
the DataGridTableStyle to hide the columns I don't want. Is there any way to
have both hidden columns and disable AddNew in a DataGrid?

Thanks
Nov 15 '05 #1
3 3835
Rdx,

You could use the click event of the grid. Then, if the currentRowIndex =
datasource.Rows.count call the endInit method of the grid. this should
allow you to use a datatable as a source to allow for table mappings and
stop the user from adding new.

hope this helps

Marco
"Rxd" <rx*@aol.com> wrote in message
news:20***************************@mb-m24.aol.com...
I have a Datagrid that should have a couple of hidden columns. I used a
DataGridTableStyle to hide the columns and it was working fine except I needed to prevent the DataGrid from allowing new rows to be added. I was told to use a DataView and set AddNew to false (thanks for the info btw) but now I can't use the DataGridTableStyle to hide the columns I don't want. Is there any way to have both hidden columns and disable AddNew in a DataGrid?

Thanks

Nov 15 '05 #2
Rxd
The click event doesn't seem to fire unless you click on a header. It doesn't
fire when you click on any of the grids cells...
Nov 15 '05 #3
Rxd,
Correct, you can check for addNew when not clicking on the elipsis(*) but on
a cell of the new Row, by doing the same verification using the
CurrentCellChanged event.

datagrid.currentCell.Rownumber
Marco
"Rxd" <rx*@aol.com> wrote in message
news:20***************************@mb-m24.aol.com...
The click event doesn't seem to fire unless you click on a header. It doesn't fire when you click on any of the grids cells...

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike Irwin | last post: by
1 post views Thread by Sagaert Johan | last post: by
reply views Thread by Rudolph Araujo | last post: by
1 post views Thread by Karine Proot | last post: by
reply views Thread by Steve Kallal | last post: by
2 posts views Thread by Stan Sainte-Rose | last post: by
reply views Thread by Nathan Franklin | last post: by
1 post views Thread by beachboy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.