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

  1. #1

    Default Sort on Date Column

    1. I have sorts on Date and Name column heads

    Initial sort is on ORDER BY Date DESC

    Date Name
    ------------------------------
    10/05/2004 Charlie
    09/30/2004 Baker
    10/10/2003 Able

    2. After then sorting on Name column, and then sorting on Date column, sort
    now appears to be literally on date text:, sorting by month and day.
    Apparently on text of date column in grid.

    Date Name
    ------------------------------
    10/10/2003 Able
    10/05/2004 Charlie
    09/30/2004 Baker



    5. Data is initially bound to grid in !IsPostBack with my
    BindDataGrid(string sortColumn) function. Works fine.

    6. Sort EventHandler has one line of code using same BindDataGrid function:
    BindDataGrid(e.SortExpression)


    How can I get it to sort on actual Date DESC? Shouldn't the postback be
    pulling an actual Date sort back from the SQLServer?

    Thanks.

    Alan


    Alan Z. Scharf Guest

  2. Similar Questions and Discussions

    1. DataGrid 2 Column Sort
      Hey gang. I know the DataGrid can use the sort methods to do sorting but is there any way to sort by 2 columns? The first column may be user...
    2. Sort DataGrid Column
      I have a DataGrid with two columns: Name and Topic. I'm trying to sort each column alphabetically. The first columns, Name, works and sorts...
    3. Sort by Date (Latest Date that is)
      :confused; Hello I have an access db which has text feilds and has a date feild set to the default value of Now() I want to be able to filter a...
    4. 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...
    5. How do you sort a 2D array with column headers?
      I have a numerical array consisting of 5000 rows and 30 columns. The first row consists of 30 ascii column labels for example L1,L2.....L30. I...
  3. #2

    Default Re: Sort on Date Column - NEVER MIND

    I needed to add "DESC" to e.SortExpression

    Thanks.

    Alan


    Alan Z. Scharf 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