Grouping & The DataGrid or DataList or Repeater Control

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Grouping & The DataGrid or DataList or Repeater Control

    Check out this code sample:
    <a href="http://aspnet101.com/aspnet101/tutorials.aspx?id=8">Nesting
    Controls</a> -
    there's even a code sample for Nesting Datalists that might be what you
    want:
    [url]http://aspnet101.com/aspnet101/aspnet/codesample.aspx?code=nest[/url]


    David Wier
    [url]http://aspnet101.com[/url]
    [url]http://aspexpress.com[/url]


    "Demetri" <Reject@Spam.com> wrote in message
    news:0b8601c35dbc$24f4be80$a301280a@phx.gbl...
    > If I have data that comes back in the following format:
    >
    > Brand City
    > --------- ----------
    > A1 New York
    > B2 New York
    > B4 New York
    > A5 Boston
    > A6 Boston
    > C3 Chicago
    > C5 Chicago
    > D1 Los Angeles
    >
    >
    > I want the page to display it this way (grouped by City):
    >
    > New York
    > A1
    > B2
    > B4
    >
    > Boston
    > A5
    > A6
    >
    > Chicago
    > C3
    > C5
    >
    > Los Angeles
    > D1
    >
    > How do I do that? All examples of populating a DataGrid
    > are all Top-Down - I need to be able to group it. Any
    > suggestions?

    David Wier Guest

  2. Similar Questions and Discussions

    1. Newbie:Access custom Itemplate(not datagrid/repeater/datalist) control values on postback
      Newbie:Access custom Itemplate(not datagrid/repeater/datalist) control values on postback Hi, I have simple Itemplate implementation with 2...
    2. DataList parrent control with a Repeater child control
      I've been trying to bind a Repeater 'child control' to a DataList control and seem to have lost the plot. Tec spec: Connection to SQL server 2...
    3. datagrid, datalist or repeater???
      I need to have a datagrid with exactly 96 rows (preferably at design time). These rows represent a possible 1/4 hour shift for an entire 24 hr...
    4. Difference between Datagrid,Datalist and Repeater control
      Hi Can any one expalin me the exact difference between above controls and when to select which control. Thanks in advance Elaiyaraja
    5. Repeater / Datalist / Datagrid
      Hi, I need to load some data from sql server database, but before showing this result set I need to filter them. Which webcontrol should I use...
  3. #2

    Default Re: Grouping & The DataGrid or DataList or Repeater Control

    Demetri,

    First look into using a view to select the records you need.

    Something like:

    Dim BrandView As New DataView(MyTable)
    BrandView.RowFilter = "State = '" & strState & "'"

    Then bind the dataview to another datagrid / datalist nested withing the
    other.

    Heres a good article on nesting datagrids:

    [url]http://www.standardio.org/article.aspx?id=155[/url]

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche


    "Demetri" <Reject@Spam.com> wrote in message
    news:0b8601c35dbc$24f4be80$a301280a@phx.gbl...
    > If I have data that comes back in the following format:
    >
    > Brand City
    > --------- ----------
    > A1 New York
    > B2 New York
    > B4 New York
    > A5 Boston
    > A6 Boston
    > C3 Chicago
    > C5 Chicago
    > D1 Los Angeles
    >
    >
    > I want the page to display it this way (grouped by City):
    >
    > New York
    > A1
    > B2
    > B4
    >
    > Boston
    > A5
    > A6
    >
    > Chicago
    > C3
    > C5
    >
    > Los Angeles
    > D1
    >
    > How do I do that? All examples of populating a DataGrid
    > are all Top-Down - I need to be able to group it. Any
    > suggestions?

    S. Justin Gengo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139