473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MasterDetail Datagrid and Dataviews

Hi all

I have a form with 2 datagrids (master-detail)
and a combobox to create a filter for the masterdatagrid.

The master-detail worked fine when i used a dataset like this :

drelRelation = New DataRelation _
("drelMasterDetail", dsMasterDetail.Tables("tblMaster").Columns("ID"), _
dsMasterDetail.Tables("tblDetail").Columns("Master ID"))
dsMasterDetail.Relations.Add(drelRelation)
dtgMaster.SetDataBinding(dsMasterDetail, "tblMaster")
dtgDetail.SetDataBinding(dsMasterDetail, "tblMaster.drelMasterDetail")
BUT now I wanna use the combobox for filtering, so I thought I could use the
DataView and the RowFilter-property

but then i can't get my master-detail part right?????
anyone any idea?
or is there a better way for this? I'm still a newbie

Thanx in Advance


Nov 21 '05 #1
2 1060
dfjhsqd,

Did you find out how to do this? I had the same setup and ran into the
exact same problem.

Regards,
Erik

"dfjhsqd" wrote:
Hi all

I have a form with 2 datagrids (master-detail)
and a combobox to create a filter for the masterdatagrid.

The master-detail worked fine when i used a dataset like this :

drelRelation = New DataRelation _
("drelMasterDetail", dsMasterDetail.Tables("tblMaster").Columns("ID"), _
dsMasterDetail.Tables("tblDetail").Columns("Master ID"))
dsMasterDetail.Relations.Add(drelRelation)
dtgMaster.SetDataBinding(dsMasterDetail, "tblMaster")
dtgDetail.SetDataBinding(dsMasterDetail, "tblMaster.drelMasterDetail")
BUT now I wanna use the combobox for filtering, so I thought I could use the
DataView and the RowFilter-property

but then i can't get my master-detail part right?????
anyone any idea?
or is there a better way for this? I'm still a newbie

Thanx in Advance

Nov 21 '05 #2
Attach a handler to the combobox SelectedValueChanged event.
In this handler, filter the CurrencyManager's DataView according your
criteria.
Which DataView is that?
This one:
DataView myView = (DataView)myCurrencyManager.List;
I haven't used this particular technique in my code but it should work
roughly like that. Let me know how it goes.

"dfjhsqd" wrote:
Hi all

I have a form with 2 datagrids (master-detail)
and a combobox to create a filter for the masterdatagrid.

The master-detail worked fine when i used a dataset like this :

drelRelation = New DataRelation _
("drelMasterDetail", dsMasterDetail.Tables("tblMaster").Columns("ID"), _
dsMasterDetail.Tables("tblDetail").Columns("Master ID"))
dsMasterDetail.Relations.Add(drelRelation)
dtgMaster.SetDataBinding(dsMasterDetail, "tblMaster")
dtgDetail.SetDataBinding(dsMasterDetail, "tblMaster.drelMasterDetail")
BUT now I wanna use the combobox for filtering, so I thought I could use the
DataView and the RowFilter-property

but then i can't get my master-detail part right?????
anyone any idea?
or is there a better way for this? I'm still a newbie

Thanx in Advance

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Junkguy | last post by:
I'm having difficulty deleting rows from a datagrid. I want to put a "delete" button on a form and achieve the same functionality as hitting the "delete" key on the keyboard for the selected row of...
2
by: Tom | last post by:
Hi, I have been through all kinds of documentation on the datagrid and dataviews. I have many expensive books that I have looked through. But nothing has really helped. I want to find out and...
0
by: mahsa | last post by:
Hi, I have a master table including customername and customerId and address and detail table including customerid and description and orderdetail I want to add update information for both master...
4
by: Mark Travis | last post by:
Hi all, I have written a simple Web Application that displays a query result onto a page using the ASP DataGrid. To Digress ======= Development information about the page is as follows 1....
1
by: J. A. Zanetti | last post by:
Hello NG, i have this problem: in my application, i have a master- detail form displaying two DataGrids binded to DataViews. While the bindings work fine when moving through the grids' rows or...
5
by: DKC | last post by:
Hi, Using VB.NET. I have a datagrid having a strongly typed array of objects as its data source. The data from the array of objects is displayed by means of a table style, which is fine, but...
1
by: Jim | last post by:
Hello, I am creating a windows form application using vb.net 2003 which displays data in a datagrid, and then, if the user wants, I produce a nicely formatted crystal report of the data. The...
2
by: shuckjunkmail | last post by:
It was suggested that I re-submit this question as a new post rather than adding onto an old and unanswered post. The basic problem has to do with the .NET datagrid and sorting. I am having...
5
by: Rami | last post by:
Hey, I Tried to bind a DataGrid to an ArrayList, and had 2 problems: 1. The DataGrid shows the Length property of the items instead of their text - how can I change that? 2. After binding, I add...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.