Dataset

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

    #1

    Dataset

    Hello,

    In my application I'm using a typed dataset.
    Now I want to display 3 row from that dataset as one listItem in a listbox.
    There are 2 rows form the same table and one linked by a id form the parent
    table.

    I also want to be able to sort on one of the 3 rows at runtime.

    How can I do this?

    Thanks in advance


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Dataset

    Fredje,

    If you are going to do some sort of display like this, then you will
    have to construct the item (text) for the listbox yourself. The reason for
    this is that data binding is going to give you one item in the list box per
    row in the table (which makes the most sense, of course).

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Fredje" <codaria@hotmai l.com> wrote in message
    news:EvZ6b.8350 $df6.298116@pho bos.telenet-ops.be...[color=blue]
    > Hello,
    >
    > In my application I'm using a typed dataset.
    > Now I want to display 3 row from that dataset as one listItem in a[/color]
    listbox.[color=blue]
    > There are 2 rows form the same table and one linked by a id form the[/color]
    parent[color=blue]
    > table.
    >
    > I also want to be able to sort on one of the 3 rows at runtime.
    >
    > How can I do this?
    >
    > Thanks in advance
    >
    >[/color]


    Comment

    • Ignacio Machin

      #3
      Re: Dataset

      Hi Fredje,

      Please clarify more your question, I think that you mean that you want to
      display 3 columns as one ListItem, if this is the case then you have to do
      as paldino says , you cannot use databinding and you will have to do the
      concatenation using a cicle. this is also true if you are planning to lookup
      the linked value on the other table and display another field instead.

      If you want to sort it then the best way is to create a DataView sorted as
      you need it and then populate the listbox.


      Hope this help,

      --
      Ignacio Machin,
      ignacio.machin AT dot.state.fl.us
      Florida Department Of Transportation

      "Fredje" <codaria@hotmai l.com> wrote in message
      news:EvZ6b.8350 $df6.298116@pho bos.telenet-ops.be...[color=blue]
      > Hello,
      >
      > In my application I'm using a typed dataset.
      > Now I want to display 3 row from that dataset as one listItem in a[/color]
      listbox.[color=blue]
      > There are 2 rows form the same table and one linked by a id form the[/color]
      parent[color=blue]
      > table.
      >
      > I also want to be able to sort on one of the 3 rows at runtime.
      >
      > How can I do this?
      >
      > Thanks in advance
      >
      >[/color]


      Comment

      • Fredje

        #4
        Re: Dataset

        Thank you both for your reaction

        You understood me right.
        Could you tell me how I can lookup that linked field?

        Thx

        "Ignacio Machin" <ignacio.mach in AT dot.state.fl.us > wrote in message
        news:%23Tvj9pgd DHA.728@TK2MSFT NGP11.phx.gbl.. .[color=blue]
        > Hi Fredje,
        >
        > Please clarify more your question, I think that you mean that you want to
        > display 3 columns as one ListItem, if this is the case then you have to do
        > as paldino says , you cannot use databinding and you will have to do the
        > concatenation using a cicle. this is also true if you are planning to[/color]
        lookup[color=blue]
        > the linked value on the other table and display another field instead.
        >
        > If you want to sort it then the best way is to create a DataView sorted[/color]
        as[color=blue]
        > you need it and then populate the listbox.
        >
        >
        > Hope this help,
        >
        > --
        > Ignacio Machin,
        > ignacio.machin AT dot.state.fl.us
        > Florida Department Of Transportation
        >
        > "Fredje" <codaria@hotmai l.com> wrote in message
        > news:EvZ6b.8350 $df6.298116@pho bos.telenet-ops.be...[color=green]
        > > Hello,
        > >
        > > In my application I'm using a typed dataset.
        > > Now I want to display 3 row from that dataset as one listItem in a[/color]
        > listbox.[color=green]
        > > There are 2 rows form the same table and one linked by a id form the[/color]
        > parent[color=green]
        > > table.
        > >
        > > I also want to be able to sort on one of the 3 rows at runtime.
        > >
        > > How can I do this?
        > >
        > > Thanks in advance
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...