R
Rick
VS 2005
The short version:
How can I set the enabled state of a button depending on if a
strongly-typed datatable has a DeleteCommand?
***************************
The long version:
I have a windows form with a binding navigator.
There are various strongly-types datatables used throughout the form
attached to controls.
In the navigator RefreshItems event I am setting various buttons enabled
states. I have a problem with the delete button which I am setting like
this:
navigator.btnDelete.enabled = navigator.bindingSource.AllowRemove
But this always evaluates to TRUE regardless is the underlying bindingsource
datatable has an adapter.DeleteCommand, i.e. its not possible to delete.
So I tried to do the same from a dataview.
Dim dv as DataView = New DataView(myTable)
navigator.btnDelete.enabled = dv.AllowDelete
But this also evaluates to TRUE.
What do I need to test to see if the underlying datatable will allow a
delete?
Rick
The short version:
How can I set the enabled state of a button depending on if a
strongly-typed datatable has a DeleteCommand?
***************************
The long version:
I have a windows form with a binding navigator.
There are various strongly-types datatables used throughout the form
attached to controls.
In the navigator RefreshItems event I am setting various buttons enabled
states. I have a problem with the delete button which I am setting like
this:
navigator.btnDelete.enabled = navigator.bindingSource.AllowRemove
But this always evaluates to TRUE regardless is the underlying bindingsource
datatable has an adapter.DeleteCommand, i.e. its not possible to delete.
So I tried to do the same from a dataview.
Dim dv as DataView = New DataView(myTable)
navigator.btnDelete.enabled = dv.AllowDelete
But this also evaluates to TRUE.
What do I need to test to see if the underlying datatable will allow a
delete?
Rick