locked
group multiple entries RRS feed

  • Question

  • User-920379671 posted

    Hi all,

    I have a grid control with multiple rows of the same data, what would be my best approach to not have multiple rows with the same data, and show only a single row thus eliminating the extra rows of data?

     

    Thanks,

    Darryl.

    Thursday, July 24, 2008 11:07 AM

Answers

  • User-1776072412 posted

    Add a DISTINCT to your query.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 24, 2008 11:13 AM
  • User-1995538749 posted

    As MelvynHarbour stated, it's best to use a SELECT DISTINCT when querying your data. Otherwise, you'd have to compare every cell within each GridViewRow to determine matches.

    If you're using 3.5, you can also use the Disctinct method if your data is already retrieved from its data source.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 24, 2008 11:16 AM

All replies

  • User-1776072412 posted

    Add a DISTINCT to your query.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 24, 2008 11:13 AM
  • User-1995538749 posted

    As MelvynHarbour stated, it's best to use a SELECT DISTINCT when querying your data. Otherwise, you'd have to compare every cell within each GridViewRow to determine matches.

    If you're using 3.5, you can also use the Disctinct method if your data is already retrieved from its data source.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 24, 2008 11:16 AM
  • User-1625823911 posted

     Can you please post the query that you are retrieving .? So that we can find the flaws in it.

    My suggestion. is better not to use "Distinct"

    Thursday, July 24, 2008 11:19 AM