473,549 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Set allowNew and allowDelete of two datagrids in a master-detailrelations hip

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.Dat aSource,
detailGrid.Data Member), CurrencyManager ).List), DataView)
With masterView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With

detailView =
CType((CType(Me .BindingContext (masterGrid.Dat aSource,
masterGrid.Data Member), 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
1 1517
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.Dat aSource,
detailGrid.Data Member), CurrencyManager ).List), DataView)
With masterView
.AllowNew = False
.AllowDelete = False
.AllowEdit = False
End With

detailView =
CType((CType(Me .BindingContext (masterGrid.Dat aSource,
masterGrid.Data Member), 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
944
by: Dave | last post by:
Hi Have Master/Detail relationship within 2 datagrids. Binding works fine, when a user selects a row in the Master grid it updates the display in the detail grid, awesome...........but.. I also have a combobox on the form, when a user selects a value it filters the Master grid, my problem is, if there are no rows displayed in the Master...
2
1450
by: Marcel | last post by:
Hi, I'm new to VS and ASP.NET and have a question about master/detail datagrids. I have a master datagrid filled with data via a component that contains a SQL adapter. Now I would like to fill a detail datagrid (which will contain a number of detail records) based on the selected master. Is it possible to
1
1038
by: Anna | last post by:
Hi there, I have a master/detail page that I've created using a datagrid inside a repeater. I need to find a way to export the entire resulting web page into Excel, and the multiple datagrids are giving me problems. I need each one to have a unique name that I can refer to in the code I'm using to generate the Excel. Any ideas on how I...
7
1514
by: erniej | last post by:
as per instructions in the walkthrough, I have managed to create a master/detail relationship between two datagrids. However I have a requirement to apply this to three datagrids and the third datagrid does not seem to reflect the selected row on the second datagrid using this method. The relevant lines of code are as follows. ' binding...
3
1023
by: TM | last post by:
I have two datagrids in my application where one grid is for the master item list and the second grid is for a shopping list. I would like to click on a button and copy items from the master list to the shopping list. Both are tied to tables in the same access mdb file. How can I copy a record from one to the other ? Is there some...
3
1211
by: Brian H | last post by:
I am looking for working examples of making use or 2 datagrids and one dataset Grid 1 master Display minimul info Grid 2 slave. Disply detail info When the user clicks a row on the master I then load Grid 2 with detail information. Thanks for any help B
1
1399
by: Agnes | last post by:
In my one datagrid, there is master - detail relationship. I can set dv.allownew = false, However, as the user click into detail, it can't set to allownew = false. Does anyone know how to solve it ?
1
1267
by: Engineerik | last post by:
dfjhsqd asked this earlier in the week and I have the same question. How can I apply a filter to the Master table when using two datagrids in a MasterDetail relationship?
6
2663
by: Doug Bell | last post by:
Hi, Is the only way to have a DataGrid (bound to a DataTable) disallow new records to bind it to a DataView with its AllowNew property set to False? Thanks Doug
2
1041
by: astro | last post by:
Is there a way to setup master-detail between 2 distinct datagrids on same form without writing code? Is there a way to setup a child datagrid - binding it to a pk on the form so when the binder position on the form changes the datagrid changes to reflect new children? I am looking for this in the 'bindings' section of the property window...
0
7524
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6048
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5372
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5089
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.