Click here to Skip to main content
15,914,594 members
Everything / Master/Detail

Master/Detail

master/detail

Great Reads

by ASP.NET Community
The GridView control was introduced with ASP.NET 2.0 and Visual Studio 2005 as a replacement for the DataGrid control.  While it has many
by n.podbielski
This article cover different solutions for Master-Detail page control/mechanism in Xamarin.

Latest Articles

by n.podbielski
This article cover different solutions for Master-Detail page control/mechanism in Xamarin.
by ASP.NET Community
The GridView control was introduced with ASP.NET 2.0 and Visual Studio 2005 as a replacement for the DataGrid control.  While it has many

All Articles

Sort by Score

Master/Detail 

11 Oct 2013 by ASP.NET Community
The GridView control was introduced with ASP.NET 2.0 and Visual Studio 2005 as a replacement for the DataGrid control.  While it has many
9 Feb 2015 by Sander Rossel
Just a simple "do or don't" question.I want to select some user data from my database and put it in an Excel (programmatically). So, I get something like SELECT a, b, c, ... (about 60 more columns) FROM Users ... couple of joins ... etc. Done.Then I have that data in my application and...
25 Feb 2015 by Sander Rossel
Just closing this one. Guess it's a do :)
27 Apr 2015 by Sascha Lefèvre
1) Append .DefaultView to these lines:Product1.DataSource = ds1.Tables[0].DefaultView;Product2.DataSource = ds2.Tables[0].DefaultView;2) Double-Click the Product1-ComboBox in the Form-Designer. It will add this to your Form-Class:private void Product1_SelectedIndexChanged(object...
27 Feb 2017 by CHill60
There is a series of tips here on CodeProject by OriginalGriff that should help you pass the information between forms.Here's the first one - Transferring information between two forms, Part 1: Parent to Child[^] - links to the others are in that article.
27 Feb 2017 by Maciej Los
In addition to solution 1 by CHill60, i'd like to provide another interesting article: Passing Data Between Forms - VB.NET Tutorials | Dream.In.Code[^]
15 Apr 2011 by Muammar©
Hi, I have two datagridview controls showing a master/detail relationship, the master loads just fine, but the detail is not loading the relative records!ps. The model was created using the designer, (ie. dragged from the database side pane)Please help.
14 Apr 2011 by Muammar©
Hi, I have these two tables from ms access showing in my datasources tree so I drag the master table and it loads just fine, but when dragging the details table from inside the masters tree, it just doesn't bound!!. It does insert new entries though, but doesn't load those records that are...
15 Apr 2011 by Albin Abel
If you have established the parent child relationship then at an event from the parent gridview get the row id. Use the GetChildRows function and bind the results to the second datagridview.for more information http://msdn.microsoft.com/en-us/library/w93sz26t%28v=VS.71%29.aspx[^]
17 Apr 2011 by Mycroft Holmes
Have you added the relationship between the 2 datatables? You are not clear how you are managing the datasources of the 2 DGVs
17 Apr 2011 by Muammar©
Ok, i don't know what exactly is the problem but vs 2010 seems to handle it just fine, I'm still interested to know the reason if somebody found out what the problem was.Cheers.
21 Aug 2013 by Love Toys
I am trying to get the growth rate of a set of databases held on my server, I have set them using the ALTER TABLE MODIFY FILE FUNCTIONI need to return them in a query so I can use in conditional formatting in SSRS to tell me if the growth rate I have set is adequate or if it needs increasing.
21 Aug 2013 by Love Toys
I have found a solution on line which i am going to try and useSELECT name, size, growth, status, size * 8 AS size_in_kb, size * 8 / 1024. AS size_in_mb, CASE WHEN status & 0x100000 > 0 THEN growth ELSE NULL END AS growth_in_percent, CASE WHEN status &...
8 Sep 2014 by nina4ever
On my form i have a textbox, 2 datagridviews (master-detail), and a search buttonSelectCommand for Master DataAdapter has a parameter to limit retrieved rows.select * from master_table where x_column = some_valuecurrently, my SelectCommand for Detail DataAdapter is :select * from...
9 Sep 2014 by George Jonsson
I am not sure but I think the problem might be your composite primary key in the detail table.I tried this code and it works fine.I used the data you provided in the question.DataTable dtMaster = new DataTable("bso_equipment_maint_bill_equ");// I have to fill the tables...
11 Sep 2014 by nina4ever
In my WinForms App. I have two DataGridViews (master-detail). The primary key (bill_equ_id) of my master table is generated on the server by a (before-insert trigger), so it's not manually inserted by the user. this key is a foreign key in my detail table.i don't know how to perform insert...
11 Sep 2014 by George Jonsson
I am not sure why you insert data to the database in the Form1_Load.In Form1_Load you have just fetched data from the database that you want to show in the datagrids, right?I think this is a case when it would be nice to have an alternate key in the Mastr table that can be used to get a...
16 Sep 2014 by mhegazy94
first insert your master data but return the id value in the same query insert into table values('1525' ,'1/1/2014' ) select @@IDENTITYand set details foreign key with this value then insert details data
19 Sep 2014 by Member 11085775
Hi,please help me, am in risk..My team head assign a task,Task:Master and Detail Form using Stored procedure in mvc 4.Master Form:Supplier ID:Supplier Name:Reecipt Date:TOtalStock Delivered:Detail Form:Add Product - [Button]ProductCode ProductName...
19 Sep 2014 by MukeshSagar
To create master details form using MVC; refer the article:Master-Details using ASP.NET MVC[^]
29 Sep 2014 by nina4ever
in my WinForms app. i have master-detail DataGridViews. i have attached a RowValidating event handler to my detail grid to make some validation and calculations.RowValidating fires whenever a detail record loses focus.the problem is: when i set focus on a detail record (for editing...
30 Sep 2014 by nina4ever
private void detailGrid_RowValidating(object sender,DataGridViewCellCancelEventARgs e){ string current_parent_row_id = masterGrid.CurrentRow.Cells["id"].Value.ToString(); string validated_parent_row_id = detailGrid.Rows[0].Cells["id"].Value.ToString(); if...
18 Nov 2014 by Engr Hammad
Private Sub TreeViewSample_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ds As DataSet Dim DaMain As New SqlDataAdapter("SELECT * FROM Main", con) Dim DaSub As New SqlDataAdapter("SELECT * FROM Sub ", con) Dim...
19 Nov 2014 by Arkadeep De
Follow this one...though its in C#, but its understandable....Binding Data With ‘TreeView’ Control Asp.net 2.0[^]
15 Feb 2015 by Member 2351001
Front End = Vb.net 2012 Database = MSSQL 2014I have 2 tables OrderMaster, OrderDetail OrderMaster Has Columns OrderId Int , Date (SmallDateTime), OrderNumber varchar(255)OrderDetail Has OrderId int, Itemid Int, Qty Int OrderMaster gets 1 Insert While OrderDetail gets Multiple...
15 Feb 2015 by _Maxxx_
You can pass a datatable as a parameter to a stored procedureThere's an article about it at Passing a datatable to a Stored Procedure in SQL Server 2008[^]So populate your datatable with the detail values, and call the SP with the table value parameter as described.
27 Apr 2015 by cookieburner
I Have a excel sheet "test.xlsx" , two sheets within sheet name :Product1 has following data :ID ParentID Title1 0 P1_12 0 P1_2sheet name :Product2 has following data : ID ParentID Title1 1 P2_12 1 P2_23 1 P2_34 1 ...
6 May 2015 by Member 10240232
[EDIT]My second datagrid is not empty anymore (it was the case when I used to have a List instead of dictionnary)My second DataGrid now works with a dictionary.But I'm not able to edit its values : exception generated, is there a reason ?Thanks
6 May 2015 by Member 10240232
The following link solved my problem :http://www.broculos.net/2014/03/wpf-editable-datagrid-and.html#.VUoU-47tlBc
9 Sep 2015 by weirdoweirdo
I was having the same issue on Visual Studio 2010, sql 2008 R2 and using WinForms, but I solved it.I also had my tables with auto generated primary key from the server (auto-increment) I used a DataSet and messed around with the DataSet Designer, created relationships, etc. But since I...
27 Feb 2017 by Member 11525501
Hello there, As i am a relative new programmer i encouter a problem that i need your help fore. I have two forms. Form 1 is called "Projectnameform" and contains address data in a gridview. Form2 is called "ProjectDetailsForm" where i have shown projectDetails.All the data is stored in a MS...
1 Jun 2017 by Peter Erler
Hello i am new to programming with wpf. I have a big Problem with an i think normal requirement. I have a Datagrid with two Columns "Project" and "Tasks" Each Task belongs to an Project. Data for Projects (ObservableCollection): Project 1 Project 2 Project 3 Data for Tasks...
17 May 2017 by CHill60
If you filter the Grid like that you are not going to be able to see the other projects because you only have one control. A better design would be to have two dropdownlists - populate the 2nd list based on a selection from the first. There is some sample code here c# - Populate WPF listbox...
7 Oct 2019 by MadMyche
Front and foremost is that your query is Vulnerable to SQL Injection. NEVER EVER build a query concatenating strings together. While this controller action only accepts an INTeger as the input value and you have some protection, it is a bad habit to get into. This vulnerability is over 20 years...
31 Aug 2016 by n.podbielski
This article cover different solutions for Master-Detail page control/mechanism in Xamarin.
16 Sep 2014 by nina4ever
public partial class Form1 : Form{ private String connectionString = null; private OracleConnection oracleConnection = null; private String equQuery = null; OracleCommand equCmd = null; private OracleDataAdapter equDataAdapter = null; private...
6 May 2015 by Member 10240232
Hi,This my very first attempt to work with WPF, I just try to populate a detail view (datagrid) from the selection of a master view (datagrid) record.I hardly based my code on a published CRUD demo project.Currently the data are mock generated for my test, the important point is that...
27 Apr 2015 by Abhinav S
TryCascading ComboBox In Winforms Windows Forms C# VB.NET[^]Cascading ComboBox in C-Sharp.Net[^]
12 Aug 2012 by WebMaster
I Update to database just genreRow then retrieve its ID.There is noway else.
11 Aug 2012 by WebMaster
There are 2 Table:MasterTable => Columns: ID, DetailTable_ID, DescriptionDetailTable => Columns: ID, TitleFirst I wanna add a row to DetailTable, then I wanna add a row to MasterTable that it will requires a new DetailTable row.ID which is -1.I want to add them to DataSet not...
14 Oct 2014 by nina4ever
i have solved the problem using a simple workaround.In detail grid CellValidating, when input is INVALID i do the following: In addition to setting e.Cancel to TRUE i also display a MessageBox to inform the user. User will click OK to dismiss the message box, and that is enough to keep...
1 Jun 2017 by Peter Erler
Hi, sorry it took a while before i could try this out. I cant solve my Problem with the provided solution! I think the database structure is the problem why the solution doesnt help. The Datacontext for my WPF Window is the table "TimeRegistration" This table contains the fields "Project",...
7 Oct 2019 by Samps Pro
i am doing with master detail. i have created the page of showing details which show the both the master and detail record.but without entityfram work its giving What I have tried: how to loop here to fetch detail record plz help public ActionResult Details(int id) { ...
7 Oct 2019 by Samps Pro
thanks for your response but i am confusing how to send a single instance of model and list view both from controlerr to model. can you please help me in writing the actionRessult detail in controller that return both master and detail with out entityframwork.my master class is posted above and...
1 Oct 2014 by nina4ever
in my WinForms app. i have master-detail DatagridViews.i have a RowValidating and CellValidating event handlers on detail grid.if detail cell/row validation fails, i set e.Cancel to TRUE. this prevents user from leaving cell/row in details grid, EXCEPT in one case : when user inserts...