Displaying current sort indication in the header of a column

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

  1. #1

    Default Displaying current sort indication in the header of a column

    Hello all,

    Using the .NET framework 1.1, is there a way to do this without too much
    coding? I've the got the sorting of my custom columns working both ways (if
    I click on the same column, it reverses the sort direction), but I would
    like to have an indication of the current sort direction by displaying an
    upward or downward pointing arrow. I had it working halfway, but I have no
    way of reverting to the original column name if I just concatenate the
    header name with a graphic.

    Is the best way to save the column header captions on the first page load or
    is there a simpler way?

    Eric


    Eric Caron Guest

  2. Similar Questions and Discussions

    1. Displaying Current Threads
      Is there a way to create a CFM page that will display all the current threads and also list the threads that are queued with the time they started,...
    2. Build a label header for DG, to sort
      Hi I write a custom control that inherits from Label, that will hold the sort expression. As long as I know, there is no built in way to get sort...
    3. Image in header column (not replacing column header text)
      I have a sortable (asc/desc) datagrid and would like to add a small arrow icon (down/up) next to the column header text to improve the UI. Is this...
    4. Displaying current frame
      I set up a dynamic text box, "page", on the stage to show the current frame number. This is a script I have not tried yet and can not get to work....
    5. Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB.
      Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. hi, guys i have asp...
  3. #2

    Default Re: Displaying current sort indication in the header of a column

    You could do it another way, such as adding a Image control into the header
    cell that shows the image. Then if the column isn't the one being sorted
    you don't add the Image control (or remove the control) from the header cell.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Hello all,
    >
    > Using the .NET framework 1.1, is there a way to do this without too
    > much coding? I've the got the sorting of my custom columns working
    > both ways (if I click on the same column, it reverses the sort
    > direction), but I would like to have an indication of the current sort
    > direction by displaying an upward or downward pointing arrow. I had
    > it working halfway, but I have no way of reverting to the original
    > column name if I just concatenate the header name with a graphic.
    >
    > Is the best way to save the column header captions on the first page
    > load or is there a simpler way?
    >
    > Eric
    >


    Brock Allen Guest

  4. #3

    Default Re: Displaying current sort indication in the header of a column

    Thank Brock,

    I found a sample that describes a similar technique, where you add a label
    control to the cell with a character from the webdings font that represents
    an upward or downward arrow (characters 5 and 6 respectively). It seems
    that if I add the control in the ItemCreated event, the control is not
    preserved between postback, so the header text returns to its default state.
    This behaviour is kind of strange to me, but I'm glad it works. =)

    Eric

    "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
    news:803460632526252551654576@msnews.microsoft.com ...
    > You could do it another way, such as adding a Image control into the
    header
    > cell that shows the image. Then if the column isn't the one being sorted
    > you don't add the Image control (or remove the control) from the header
    cell.
    >
    > -Brock
    > DevelopMentor
    > [url]http://staff.develop.com/ballen[/url]
    >
    >
    >
    > > Hello all,
    > >
    > > Using the .NET framework 1.1, is there a way to do this without too
    > > much coding? I've the got the sorting of my custom columns working
    > > both ways (if I click on the same column, it reverses the sort
    > > direction), but I would like to have an indication of the current sort
    > > direction by displaying an upward or downward pointing arrow. I had
    > > it working halfway, but I have no way of reverting to the original
    > > column name if I just concatenate the header name with a graphic.
    > >
    > > Is the best way to save the column header captions on the first page
    > > load or is there a simpler way?
    > >
    > > Eric
    > >
    >
    >
    >

    Eric Caron 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