locked
How to show one row per key having multiple values in asp.net webform ListView RRS feed

  • Question

  • User-794304219 posted

    Hi All,

    I have data like the below format.

    Resource Project
    A ABC
    A PQR
    B ABC
    B XYZ
    B PQR

    When I populate the Above data in the asp.net listview, I get the data in the same format (multiple rows for the same resource because of multiple projects assigned), whereas the desired output should be one row per resource (and assigned projects should be in the dropdown in the same row)

    Resource Project
    A ABC
    PQR
    B ABC
    PQR
    XYZ
    Tuesday, May 25, 2021 10:17 AM

All replies

  • User475983607 posted

    Web forms uses a tree to build the final HTML.   A nested ListView is required.  First the outer data is bound "A" then the nested data for "A" is bound and so on until the entire structure is built.

    A repeater and a nested ListView is another approach or just a repeater and markup could work.  It depends on your UI design.

    Google for examples

    Tuesday, May 25, 2021 10:35 AM