dynamicly created data

  • Thread starter Thread starter newone
  • Start date Start date
N

newone

Hello.

I need one basic solution for this newbee problem.
I have basic user labels like name, lastname etc on left side of one
groupbox.
Now i want to display data for each label, but this data should be set
dynamicly.
The data should come from datagridview or from one listbox(data from listbox
is also connected to datagrid). Something like, you choose one user from
datagrid but you want do display just some short info about hih in some
other groupbox.

Name ?
Lastname ?
//--------------------
After click on datagridview or listbox:
Name Jane
Lastname Doe
//--------------------
How to make this ?

Thank you in advance.
 
Thank you for reply.
I will start step by step.
This is the first option ( not a datagrid ).

I set one listbox with 5 users. lstboxUsers.
One, two, three, four, five.

When i click on each of them i want to see this extended info in other group
box.
E.g. if i click on "One" in my message box, user data should be passed into
labels in another group box. Like described in previus post, but without
datagrid.

All extended data is in database, so all i need is to pull it out on user
click.
 
I'm sorry for my "bad" description.

Accessing the data from the database?
Or setting the labels?
---------------------------------------------
Both. Please look at this link:
http://tinypic.com/view.php?pic=hwj2iu&s=7

This is what im doing now.
All data for extended user info are in sql table users.
So now i need to find a way how to display it on "Select user" button click.
 
Hello.

I need one basic solution for this newbee problem.
I have basic user labels like name, lastname etc on left side of one
groupbox.
Now i want to display data for each label, but this data should be set
dynamicly.
The data should come from datagridview or from one listbox(data from listbox
is also connected to datagrid). Something like, you choose one user from
datagrid but you want do display just some short info about hih in some
other groupbox.

Name ?
Lastname ?
//--------------------
After click on datagridview or listbox:
Name Jane
Lastname Doe
//--------------------
How to make this ?

Thank you in advance.

Hi,

Actually it is very easy and there is no code required.
Visual Studio has made the data binding is simply a mouse-click process.
From your above description, I assume you already have BindingSource
object ready. Click on the label to view its property. Click
DataBindings -> Advance -> ... (the three dots) to open the "Formatting
and Advance Binding" dialog box. On the Binding combo box, select the
value from the bindingsource object that you would like your label to
bind to. Click OK. Repeat for all the other labels. It is done. F5.
Whenever you select the item in your listbox, all the labels will follow.

Regards.
 
Back
Top