Link to home
Start Free TrialLog in
Avatar of charlieb01
charlieb01

asked on

Configure a DataGrid for limited user access

Hi,

I have a datagrid that is bound to a datatable in code and I am using DataGridTableStyles to format the grid just the way I want it to look. I don't want the user to be able to add any new rows so I set the dagatgrid.ReadOnly property to TRUE. However, there is one column of rows that I do want the user to be able to change. In this case I was thinking the user could type a new number in a particular cell and then click on a button to store the changes back to the original database table.

So, is there any way to prevent the user from adding rows to a datagrid and keep the entire datagrid as Read-)nly except for one column?

Thanks,
Charlie
ASKER CERTIFIED SOLUTION
Avatar of mytonytiger
mytonytiger

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mytonytiger
mytonytiger

The Second part of your question is about locking down all but one column:

You can set each individual column of the datatable as readonly.

ds.tables(0).Columns(0).readonly = True
ds.tables(0).Columns(1).readonly = True
ds.tables(0).Columns(2).readonly = True
'etc....
ds.tables(0).Columns(3).readonly = false ' This one is editable.



Hope that helps