G
Gary200
Hello All,
I bind two datagrids in a master-detail relationship successfully.
What I want is to set allowNew and allowDelete disabled in both datagrid
using dataview.
The code like this:
Dim masterGrid As DataGrid
Dim detailGrid As DataGrid
Dim detailView As DataView
Dim masterView As DataView
masterView =
CType((CType(Me.BindingContext(detailGrid.DataSource,
detailGrid.DataMember), CurrencyManager).List), DataView)
With masterView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With
detailView =
CType((CType(Me.BindingContext(masterGrid.DataSource,
masterGrid.DataMember), CurrencyManager).List), DataView)
With detailView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With
I used the same method for the master and detail grid, but it works only
on master datagrid, not on detail grid.
If I set the datamember of the detail grid to the detail table not the
master-detail relationship,
then the detail grid works correctly, but not what I want. Set the
dataview works only on single grid not two related datagrids.
So, I think may be either the relationship or dataview I'm using is
wrong. Does anybody know?
Thanks in advance.
Regards,
Gary.
I bind two datagrids in a master-detail relationship successfully.
What I want is to set allowNew and allowDelete disabled in both datagrid
using dataview.
The code like this:
Dim masterGrid As DataGrid
Dim detailGrid As DataGrid
Dim detailView As DataView
Dim masterView As DataView
masterView =
CType((CType(Me.BindingContext(detailGrid.DataSource,
detailGrid.DataMember), CurrencyManager).List), DataView)
With masterView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With
detailView =
CType((CType(Me.BindingContext(masterGrid.DataSource,
masterGrid.DataMember), CurrencyManager).List), DataView)
With detailView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With
I used the same method for the master and detail grid, but it works only
on master datagrid, not on detail grid.
If I set the datamember of the detail grid to the detail table not the
master-detail relationship,
then the detail grid works correctly, but not what I want. Set the
dataview works only on single grid not two related datagrids.
So, I think may be either the relationship or dataview I'm using is
wrong. Does anybody know?
Thanks in advance.
Regards,
Gary.