Newbie Question - Datagrid Results

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Newbie Question - Datagrid Results

    Is there a way to display the field you are GROUPING BY in a datagrid? I am doing a select count and using the GROUP BY option to display the results. When the results are displayed in the datagrid it just shows the results but not the field it is being GROUPED BY (probably getting what I am asking for).

    Current Results Example

    Total
    10
    5
    7
    10

    I would like to see the name field I am sorting by displayed in the datagrid

    Name Total
    Allen 10
    Beth 5
    Carol 7
    Tom 10

    Any help is appreciated!

    Thanks,
    Keith

    Keith Guest

  2. Similar Questions and Discussions

    1. Newbie question on focus within DataGrid
      I have a datagrid that is being populated in edit mode on load (I didn't come up with the requirements, I'm just trying to make it work). Any...
    2. Newbie Question on Web DataGrid Focus
      I have a datagrid that is being populated in edit mode on load (I didn't come up with the requirements, I'm just trying to make it work). Any change...
    3. Datagrid newbie question
      Hey all, I'm dynamically creating X number of datagrids based on entries in a database (1 per client type thing... data is from different...
    4. Newbie Question: fill a dataset with results from web service call
      I am trying to get a better grasp of using web services. I have had success when I have a user type something into a text box and then pass that...
    5. Newbie Question about datagrid select
      Well, don't see my other post, so.. here goes again. I need to do a select column that when clicked shows another link button in the select...
  3. #2

    Default Re: Newbie Question - Datagrid Results

    Hi Keith,

    Just add a select distinct to to your query similiar to :

    select distinct name, sum(user_item) as Total from user_items group by
    user_item;

    Hope this helps!

    GregC

    GregC Guest

  4. #3

    Default Re: Newbie Question - Datagrid Results


    Also you can store the current group in a variable and show it

    --
    bh_jodokas
    -----------------------------------------------------------------------
    bh_jodokast's Profile: [url]http://www.highdots.com/forums/m97[/url]
    View this thread: [url]http://www.highdots.com/forums/t300578[/url]

    bh_jodokast 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