How to Lock DataGrid but still allow an Edit?

  • Thread starter Thread starter RamChip
  • Start date Start date
R

RamChip

Can you have a DataGrid (displaying about 7 rows of an Access DB).

Out of 10 displayed columns, I currently only allow the user to edit ONE
column (ie: Hours). The DataGridTextBoxColumn's are all set to READ ONLY
except the one I want to edit.

However, the bottom of the DataGrid allows a User to click on the Blank New
Row cellls.

What I'd like to do is to have the whole DataGrid set to READ ONLY (thus
getting rid of the last Blank Row... but still be able to Edit the one Hours
Column...

Can this be done?

Mucho Appreciated.

Robert
 
The view that you are binding to the datagrid has
properties associated with it. I think they are
AllowNew,AllowEdit,AllowDelete

Just set them to what you want.
 
There is a property called AllowAddNew which should turn off that ability.

HTH
--
============
Frank Hickman
NobleSoft, Inc.
============

Replace the _nosp@m_ with @ to reply.
 
Frank Hickman said:
There is a property called AllowAddNew which should turn off that ability.

Hmm. Well... for one I've all but NO knowledge on DataGrids other than the
easy to access Properties. So I've no idea on how to drill down to do what
you are suggesting (basically I don't understand 'how to') :(

I would have thought that I could do all of this in the TableStyle Collection
Editor. But I guessed wrong.

Can you please point me a bit closer?

Thanks!

Robert
 
If your using VB it should be accessible in code like...

DataGrid.AllowAddNew = false

or in C++ like...

datagrid.SetAllowAddNew( false );

HTH
--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
 
Back
Top