By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

Set allowNew and allowDelete of two datagrids in a master-detailrelationship

P: n/a
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.DataSour ce,
detailGrid.DataMember), CurrencyManager).List), DataView)
With masterView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With

detailView =
CType((CType(Me.BindingContext(masterGrid.DataSour ce,
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.
Aug 10 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nobody knows? :(
Just want to display the master-detail data. So bad. Actually it is a
Parent-Child-GrandChild relation. Or any other ideas?

Many Thanks.
Gary
Gary200 wrote:
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.DataSour ce,
detailGrid.DataMember), CurrencyManager).List), DataView)
With masterView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With

detailView =
CType((CType(Me.BindingContext(masterGrid.DataSour ce,
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.
Aug 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.