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

Datagridview -can multiple rows affect sub records?

Hi guys,

I have a quick question which i have pondered for a little while. I'm not sure if its even a good idea (so maybe advice on whether or not to do it would be helpful as well).

I want to have my first datagridview to have a multi-select (which i have currently), but what i want to happen when multiple rows are selected is different. I have a sub datagridview which is using a relationship in a dataset which allows the two datagridviews to interact with each other.

When i select more than one row in the parent datagridview, i want the sub-datagridview to show the records for all parent records selected, so record A has 4 sub items and record B has 3, therefore 7 records are now shown. Is this possible?

Cheers,
Gun slinger
Feb 3 '09 #1
6 4095
Frinavale
9,735 Expert Mod 8TB
When you say "sub DataGridView" do you mean aDataGridView within a parent DataGridView?
Or do you simply mean that there are 2 GridViews on the page?

What you are attempting to do is possible.
All you have to do is update the data source for your "sub GridView".

(PS what language are you implementing your solution in?)
Feb 4 '09 #2
Thanks for the reply Frinavale.

My language is C#. There are two datagridviews (sometimes more, depending on my program). One of them is technically a sub datagridview because it uses a child datasource from a dataset relation.

I understood that it might be possible, however, i wanted to know if it was easy to implement without having to rewrite the entire datagridview by inheriting it and making my own datagridview.

So basically i have to make it when i select a row on the parent, i update the childs select statement to be, " Where ID = '1' and ID = '2'" or something like that? Let me know if thats the only way to do it.

Cheers
Feb 5 '09 #3
Hi guys,

Has anyone got a solution for this? I would like to be able to add it easily, but if i have to do it manually, is there a project already in existence?
Feb 18 '09 #4
Frinavale
9,735 Expert Mod 8TB
You can search for a project if you want to but from the sounds of it you're going to want to write this yourself.

You should see if templates would help you in your solution (instead of "sub GridViews")
Feb 18 '09 #5
Cheers.

Bugger, this might be a little bit painful to make. Also, just out of interest, that template field only seems to be for asp.net, as a web UI control, not a form control?

Before i make a commitment to making a control capable of something such as what i have described. Does it actually sound like a good way to allow the user to interact with a database type program? I mean, if there isn't something already implemented, that means that there isn't a large deal of interest for something like that i guess....
Feb 18 '09 #6
Frinavale
9,735 Expert Mod 8TB
@Gun Slinger
Right before I read your response I thought to myself "I'm an idiot: he's asking about a DataGridView not a GridView". I'm sorry, that template field is a powerful tool used with ASP.NET GridViews and doesn't apply to your problem.

@Gun Slinger
I find that having tables within tables within tables gets confusing to the end user. My designs tend to be linear so that it is easy for the end user to read.

I've had situations where sub grids would have been used but opted for a "show details" button instead that would display the extra details in a separate control in it's own window/section on the screen.

Not all solutions can implement such a method and you may decide that this isn't feasible.

-Frinny
Feb 18 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: DraguVaso | last post by:
Hi, I'm using the DataGridView in VB.NET 2.0. The DataSource is a Generic List of a custom class0: lstMyPersonnes = New List(Of clsPersonne). When I add a new clsPersonne to lstMyPersonnes,...
10
by: milk-jam | last post by:
I'm trying to set my datagridview so that the first row will be left blank and to use it as a filtering filed for the datagridview. Until now I was using 2 datagridview the upper one with a header...
6
by: dbuchanan | last post by:
Hello, Is this a bug? Is there some kind of work around? I want to add default values for a few columns in my datagridview I found the "DefaultValuesNeeded" event for the datagridview I...
1
by: Dave A | last post by:
Hi, I am struggling with two way databinding in WinForms and the DataGridView. I am binding to business object classes (rather than datatables). If I have a collection of these business...
7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
2
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added...
2
by: michael sorens | last post by:
I have been trying to figure out how to use DataSets, BindingSources, DataGridViews, and XML together, but it is a challenge. I understand how to populate a DataGridView with XML basically as: ...
0
by: Andrus | last post by:
I tried to use modeless picklist for DataGridView custom ComboBoxColumn without success. Steps to reproduce issue: 1. Run code 2. Enter some character 3. Press Tab Observed:
1
by: Jeff | last post by:
Hey ..NET 2.0 I've created a User Control which contain a DataGridView. This User Control is displayed on a TabPage. This TabPage is added to the TabControl during runtime. The problem is...
18
by: Andrus | last post by:
Marc, Thank you very much. I have issue on implementing add row properly using this. User presses down arrow in last row in grid starting adding new row. Then user changes its mind desiding...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.