473,419 Members | 2,686 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,419 software developers and data experts.

Access User Control from another User control in Winforms - C#

hello -

I am newbie in winforms and c#.

i have a mainform.cs and it has 2 user controls - leftView and rightView.

In leftView.cs i am instantiating a new clientLeftView(another user control) and also the clientRightView(another user control)

Now clientLeftView has a lstClient - list box.

clientRightView has a tab control with 3 tab pages.
- first tab page has the client username, client first name, client last name.
- second tab page has the locations information and a dataviewgrid
- third tab page has the software license information and a dataviewgrid

What should happen?

When a specific client is selected from the lstClient from the clientLeftView, the respective details of the client from the clientRightView has to displayed.

Now for this purpose i am trying to access the clientRightView from clientLeftView user controls - but i am not knowing how to do it.

I tried to use the EventHandler but i am not knowing how exactly to do it.

Any tips/ideas/code are really appreciated.

Thanks,
kumar
Nov 2 '06 #1
2 10075
hey!
I suppouse you're using some data source. so the easiest way is to make a typed data set and in it create the table(s) representing proper querries from your data source...
project->add->new item->DataSet..
in the dataset designer:
rigth click->add->table adapter
in the last page of the wizard uncheck all options.. the wizard will generate a table..
then you put na object of your dataset class on the form, then add a binding source object and set it's data soudce property to the dataset you added and the datamember property to desired table. next set controls datasource and property to the binding source and the databindings->text to proper field in the selected table
Dec 11 '06 #2
Ahhh an easy one. Don't overthink it.

Create a class and call it something Like controlManager.
Fire events from your controls and subscribe to them and handle them in this control.

When something occurs on the left control fire an event. Handle it in the controlManager and update the right control from that class. Don't worry about talking to the controls directly. Let the class receive messages and dipatch them appropriately.

: )
Dec 12 '06 #3

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

Similar topics

13
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded....
3
by: Roy Osherove | last post by:
Hi folks. I have an ASP.Net application that runs a .Net dll that uses WMI and ADSI(both managed) to connect to a given IIS root and search through it. When not using the ASP.Net client, but...
5
by: jqpdev | last post by:
Hello all... I'm coming from a Borland Delphi background. Delphi has a specific component called a Data Module. In the designer the Data Module behaves like a windows form. A developer can...
5
by: Burton Roberts | last post by:
When using ASP.NET and an OleDBConnection control I get this error on CNN.Open: "The Microsoft Jet database engine cannot open the file 'C:\A2K\Backups\EdsBe2K.mdb'. It is already opened...
24
by: Rob R. Ainscough | last post by:
VS 2005 I have: ClickOnce deployment User's that hate and or don't want to use an IE Client (don't blame them) I don't see how ASPX web pages are going to survive? With .NET 2.0 and clickonce...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
0
by: jonathan.beckett | last post by:
I have been working on a client project recently that is using winforms ..NET user controls within web pages in Internet Explorer, and need to find out how to make the user control communicate back...
1
by: Ralph | last post by:
Okay I have a website where the user is going to hit a button to kick off a process that is going to take a long amount of time. Is there anyway without using AJAX, or possibly a windows control on...
1
by: ben.brearley | last post by:
Hi All, Does anyone know of any way to launch C# forms from an MS Access application? Weird question I suppose, but the reason is that I am wanting to rewrite a MS Access application into a...
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?
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...
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
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,...
0
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...

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.