This technique disallows delete of whole grid. I want to prohibit delete of
some identified rows. for example I know that I should disallow deletion of
second row but others may be deleted.
Any help or comment is appreciated.
Hamed
"AMDRIT" <am****@hotmail.comwrote in message
news:er****************@TK2MSFTNGP04.phx.gbl...
Datagridview
AllowUserToDeleteRows {true or false}
Datagrid
set the allow delete of the dataview that is bound to it to false
dim dt as datatable
dim dv as dataview
dim dbg as datagrid
'Get the default view from the table
dv = dt.defaultview
'Disallow deleted
dv.allowdelete = false
'Set the datasource
dbg.datasource = dv
"Hamed" <ha***@raymehr.comwrote in message
news:eB**************@TK2MSFTNGP05.phx.gbl...
>Hello
I have a DataGrid that a is bound to a DataTable. Some of the rows in the
DataTable should not be deleted. How can I prohibit deleting of some
identified rows?
The problem could be specified in the following format too:
There is a DataView object that I want to prohibit deleting of some of
its DataRowView objects. that is: when drv.Delete() is called (drv is the
identified DataRowView) it doesn't delete the DataRowView object
(suppress that the Deleted tag is assigned to the RowState) . How can I
do this job?
Regards
Hamed