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

Listboxes with Databindings

Hi!
I've two list boxes, both bind to different datasources (Datatable),
but showing the same MemberValue (UserID)
The listboxes are placed in a form which shows detail information from
a datagrid about the actual selected row. The left box shows the
avaible users, the right one the users added to actual selected row in
the datagrid.
When I select an Item in the left box and then click on a button, I
want that the Item is added to the right. On the left it should not be
anymore avaible.
Showing the items in the right box is not a problem, because it's a
related table to the datagrid. But how can I show only the users that
are not in the right box, when this box is bounded to whole user
datable (which has now relation)?

Thanks for help!

Jul 27 '07 #1
4 1799
On Fri, 27 Jul 2007 07:55:11 +0200, Joerg <jo********@scs-software.chwrote:
Hi!
I've two list boxes, both bind to different datasources (Datatable),
but showing the same MemberValue (UserID)
The listboxes are placed in a form which shows detail information from
a datagrid about the actual selected row. The left box shows the
avaible users, the right one the users added to actual selected row in
the datagrid.
When I select an Item in the left box and then click on a button, I
want that the Item is added to the right. On the left it should not be
anymore avaible.
Showing the items in the right box is not a problem, because it's a
related table to the datagrid. But how can I show only the users that
are not in the right box, when this box is bounded to whole user
datable (which has now relation)?

Thanks for help!

Hi Joerg,

I'm not sure I completely follow you, if you move a user from the left ListBox to the right one, can't you just delete that entry from the left DataSource (or set a value on some column that you can filter by)?

--
Happy coding!
Morten Wennevik [C# MVP]
Jul 27 '07 #2
On 27 Juli, 07:55, Joerg <joerg.b...@scs-software.chwrote:
Hi!
I've two list boxes, both bind to different datasources (Datatable),
but showing the same MemberValue (UserID)
The listboxes are placed in a form which shows detail information from
a datagrid about the actual selected row. The left box shows the
avaible users, the right one the users added to actual selected row in
the datagrid.
When I select an Item in the left box and then click on a button, I
want that the Item is added to the right. On the left it should not be
anymore avaible.
Showing the items in the right box is not a problem, because it's a
related table to the datagrid. But how can I show only the users that
are not in the right box, when this box is bounded to whole user
datable (which has now relation)?

Thanks for help!
Hello Joerg,

I'm not sure I follow you either, and I'm also kind of new to .NET
programming..! But I just wanted to mention that I spent many hours
trying to figure out how to use ListBox:es as well, when I suddenly
realised that the ListView component offers much more flexibility =)
So I was just thinking, maybe you want to use two ListView:s instead??

/JagdPanther

Jul 27 '07 #3
No I can't delete the entry from the data source, because when I move
to the next record in the datagrid, I mus refresh the values,
depending what is shown on the right.
but a filter could be a good idea

On 27 Jul., 09:14, "Morten Wennevik [C# MVP]"
<MortenWenne...@hotmail.comwrote:
On Fri, 27 Jul 2007 07:55:11 +0200, Joerg <joerg.b...@scs-software.chwrote:
Hi!
I've two list boxes, both bind to different datasources (Datatable),
but showing the same MemberValue (UserID)
The listboxes are placed in a form which shows detail information from
a datagrid about the actual selected row. The left box shows the
avaible users, the right one the users added to actual selected row in
the datagrid.
When I select an Item in the left box and then click on a button, I
want that the Item is added to the right. On the left it should not be
anymore avaible.
Showing the items in the right box is not a problem, because it's a
related table to the datagrid. But how can I show only the users that
are not in the right box, when this box is bounded to whole user
datable (which has now relation)?
Thanks for help!

Hi Joerg,

I'm not sure I completely follow you, if you move a user from the left ListBox to the right one, can't you just delete that entry from the left DataSource (or set a value on some column that you can filter by)?

--
Happy coding!
Morten Wennevik [C# MVP]- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Jul 30 '07 #4
Thanks JagdPanterh
No, the listview is not the correct control tho show the items I have
in the datasource. I only want show users and move them from on box to
the other.

On 27 Jul., 11:41, JagdPanther <david.rundqv...@gmail.comwrote:
On 27 Juli, 07:55, Joerg <joerg.b...@scs-software.chwrote:


Hi!
I've two list boxes, both bind to different datasources (Datatable),
but showing the same MemberValue (UserID)
The listboxes are placed in a form which shows detail information from
a datagrid about the actual selected row. The left box shows the
avaible users, the right one the users added to actual selected row in
the datagrid.
When I select an Item in the left box and then click on a button, I
want that the Item is added to the right. On the left it should not be
anymore avaible.
Showing the items in the right box is not a problem, because it's a
related table to the datagrid. But how can I show only the users that
are not in the right box, when this box is bounded to whole user
datable (which has now relation)?
Thanks for help!

Hello Joerg,

I'm not sure I follow you either, and I'm also kind of new to .NET
programming..! But I just wanted to mention that I spent many hours
trying to figure out how to use ListBox:es as well, when I suddenly
realised that the ListView component offers much more flexibility =)
So I was just thinking, maybe you want to use two ListView:s instead??

/JagdPanther- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Jul 30 '07 #5

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

Similar topics

4
by: bill yeager | last post by:
I have several template columns inside of a datagrid. Inside of these template columns are databound listboxes: <asp:TemplateColumn HeaderText="Crew Chiefs"> <ItemTemplate> <asp:listbox...
0
by: Terry D | last post by:
I'm having an issue with an ASP.NET page (VS.NET 2003, VB.NET, Oracle back end). The page uses the standard VS.NET grid to display the records from a particular table. The user can edit certain...
1
by: Ryan Ternier | last post by:
I have two listboxes, and allow users to move items between them via the following function: function SwitchList(fbox, tbox){ var arrFbox = new Array(); var arrTbox = new Array(); var...
0
by: Luis Esteban Valencia | last post by:
have a problem and I'm not sure how to handle/fix it. I have three listboxes on my page. The first listbox has a list of software products. When you select an item in the Products listbox, then...
9
by: HAN(removethis)twister | last post by:
I've tried to create 11 textboxes as variables (not actually visible in the program, not in Windows Form Designer) and have set DataBindings to the text properties of the TextBoxes BUT according to...
2
by: C Glenn | last post by:
This is admitedly vague. But so is my understanding of the problem. I'm using this chunk of code: retControl.DataBindings.Add(ctrlBinding.PropertyName,DataSource,BindingField); This resolves...
2
by: salad | last post by:
This is a tip on how to speed up listboxes DRAMATICALLY. Persons that would benefit are those that are constantly updating the rowsource of a listbox/combobox in order to filter and sort the data...
0
by: XenReborn | last post by:
Ok this should be simple. I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database,...
0
by: Anil Gupte | last post by:
I am having some issues with Listboxes Here is my code: Dim DSContent As New DataSet DSContent = L3GContent.GlobalDataSet URLListBox.BeginUpdate() For Each dr As DataRow In...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.