Listboxes with Databindings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joerg

    #1

    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!

  • Morten Wennevik [C# MVP]

    #2
    Re: Listboxes with Databindings

    On Fri, 27 Jul 2007 07:55:11 +0200, Joerg <joerg.baas@s cs-software.chwrot e:
    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]

    Comment

    • JagdPanther

      #3
      Re: Listboxes with Databindings

      On 27 Juli, 07:55, Joerg <joerg.b...@s cs-software.chwrot e:
      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

      Comment

      • Joerg

        #4
        Re: Listboxes with Databindings

        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.comwro te:
        On Fri, 27 Jul 2007 07:55:11 +0200, Joerg <joerg.b...@s cs-software.chwrot e:
        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 -

        Comment

        • Joerg

          #5
          Re: Listboxes with Databindings

          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.comwrot e:
          On 27 Juli, 07:55, Joerg <joerg.b...@s cs-software.chwrot e:
          >
          >
          >
          >
          >
          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 -

          Comment

          Working...