473,396 Members | 1,935 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,396 software developers and data experts.

Master / details grid

M
Hy,
I would like to create a master /detail datagrid,
that is a datagrid that (when I click on an item)
shows some other item's details
expanding the rows under the selected grid

Can someone help me with this?

Thanks!

M@
Nov 18 '05 #1
4 1434
I do not know of one exactly like you describe, but Dino Esposito created a
1.1 version of the DetailsView control from 2.0 Framework (Visual Studio
2005, now in beta):

http://msdn.microsoft.com/asp.net/co...etailsview.asp

Good code sample and it might help you with your issue.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"M@" wrote:
Hy,
I would like to create a master /detail datagrid,
that is a datagrid that (when I click on an item)
shows some other item's details
expanding the rows under the selected grid

Can someone help me with this?

Thanks!

M@

Nov 18 '05 #2
Try this

http://www.dotnetjunkies.com/Tutoria...63C4C9BBC.dcik

Vinay

"M@" wrote:
Hy,
I would like to create a master /detail datagrid,
that is a datagrid that (when I click on an item)
shows some other item's details
expanding the rows under the selected grid

Can someone help me with this?

Thanks!

M@

Nov 18 '05 #3
M,
I have done this in a web application I wrote. As you probably know, the
datagrid web control does not inherently support master-detail datagrids.
What you need to do is:

1. Add a select button column to your datagrid (a simple google search
will give you simple instructions on this
2. Perhaps change the "selecteditem" style to bold or something to make
it stand out
3. Add the following to your html tag for the datagrid:
"Onselectedindexchanged = "datagrid1_SelectedIndexChanged" This will fire
an event when you hit the select button for a particular row in your
datagrid
4. Set your "DataKeyField" property on the datagrid to the table's field
value that links it to the detail datagrid (usually a primary key field i.e.
AuthorID)
5. Create a second datagrid (your detail datagrid)
6. In the datagrid1_SelectedIndexChanged Sub, set up and execute a
connection/command with a SQL statement that references the selectedindex of
the master datagrid in the WHERE clause of your SQL statement (i.e. SELECT
booktitles, ISBNNumber FROM tbl_Books WHERE AuthorID =
datagrid1.items.item(datagrid1.selecteditem.itemin dex).Cells(0).Text
7. Bind your detail datagrid and refresh the page

That should get you started in the right direction.

"M@" <no*@sorry.com> wrote in message
news:Cj********************@twister1.libero.it...
Hy,
I would like to create a master /detail datagrid,
that is a datagrid that (when I click on an item)
shows some other item's details
expanding the rows under the selected grid

Can someone help me with this?

Thanks!

M@

Nov 18 '05 #4
M
> 5. Create a second datagrid (your detail datagrid)

Ok, that's correct, but the effect I would like ti reproduce is different:
only one datagrid, when the user click on the item
the selected row expands itself and shows
some detailed information.

Have you ever seen some grid like this?

Thanks

M@
Nov 18 '05 #5

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

Similar topics

1
by: Shiva | last post by:
Hi, My (main)form has a subform that contains the details of the mainform. The default view of the mainform is 'single form', the default view of the subform containing the details is...
2
by: Bala | last post by:
Hi I have the following table structure. employee table structure 1.empid 2.cateid 3.empname Category table 1.cateid
0
by: hlam | last post by:
Help - Calculating the total of a column in a data grid -- when data grid is part of Master-Detail set-up I have setup a Master-Detail form using Visual Studio.Net. A ListBox is the (Master)...
1
by: solex | last post by:
Hello, I am trying (unsuccessfully) to display a Master-Detail-Detail records. The problem comes in the second detail grid. The first detail grid is displaying correctly but it is not...
2
by: HS1 | last post by:
Hello all I followed the example in Visual Studio.net to create a master and detail relationship as following: two tables: Customers and Orders two DataGrid: GridOrders and GridDetails...
1
by: HS1 | last post by:
Hello all - I have a master and a details table presented in two datagrid - I also have some text boxes that present the values from any record in the master table. This also helps to enter new...
1
by: brian.newman | last post by:
I'm trying to link a gridview to another gridview in a Master-Details architecture. But the Details list isn't filtering like it is suppossed to. It will show all items on page load and it won't...
0
by: Mike Wilson | last post by:
Dear group, I have an invoice entry form, which is a simple Master fields / Detail grid. The main summary information of the invoice are stored in one table in a dataset, which is bound using a...
3
by: Gina_Marano | last post by:
Hey All, Working with the .Net data has been the hardest part of my transition. It just doesn't seem very intuitive. I want to have a master/detail relationship between 2 grids. When the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.