Sorting DataView problem

Discussion in 'ASP .Net Web Controls' started by Julia, Jun 21, 2006.

  1. Julia

    Julia Guest

    Hi

    I have a control including a DataGrid. The DataGrid is bound to a DataView.
    The first column of the DataGrid contains numbers from 1, 2, 3, 4, ... I want
    to show them in order so I edit the sort property of the DataView like this:
    dvDocumentKind.Sort = "DocumentInfo_No";

    When i run the page the order in the DataGrid is shown like this: 1, 10, 11,
    2, 3, 4, 5, 6, 7, 8, ,9, 12, 13, .... 19, 20, 21, 22 etc. Why is 10 and 11
    shown after 1?

    Thanks
    Julia
     
    Julia, Jun 21, 2006
    #1
    1. Advertising

  2. Julia

    Hege Servold Guest

    10 and 11 are shown after 1 because the values are sorted as strings, not as
    integers.
    --
    Hege Servold
    hege.servold(AT)bekk.no


    "Julia" wrote:

    > Hi
    >
    > I have a control including a DataGrid. The DataGrid is bound to a DataView.
    > The first column of the DataGrid contains numbers from 1, 2, 3, 4, ... I want
    > to show them in order so I edit the sort property of the DataView like this:
    > dvDocumentKind.Sort = "DocumentInfo_No";
    >
    > When i run the page the order in the DataGrid is shown like this: 1, 10, 11,
    > 2, 3, 4, 5, 6, 7, 8, ,9, 12, 13, .... 19, 20, 21, 22 etc. Why is 10 and 11
    > shown after 1?
    >
    > Thanks
    > Julia
     
    Hege Servold, Jun 21, 2006
    #2
    1. Advertising

  3. Julia

    Julia Guest

    Hi

    Yes, that helped!

    Thanks
    Julia

    "Hege Servold" wrote:

    > 10 and 11 are shown after 1 because the values are sorted as strings, not as
    > integers.
    > --
    > Hege Servold
    > hege.servold(AT)bekk.no
    >
    >
    > "Julia" wrote:
    >
    > > Hi
    > >
    > > I have a control including a DataGrid. The DataGrid is bound to a DataView.
    > > The first column of the DataGrid contains numbers from 1, 2, 3, 4, ... I want
    > > to show them in order so I edit the sort property of the DataView like this:
    > > dvDocumentKind.Sort = "DocumentInfo_No";
    > >
    > > When i run the page the order in the DataGrid is shown like this: 1, 10, 11,
    > > 2, 3, 4, 5, 6, 7, 8, ,9, 12, 13, .... 19, 20, 21, 22 etc. Why is 10 and 11
    > > shown after 1?
    > >
    > > Thanks
    > > Julia
     
    Julia, Jun 21, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders

    Re: alpha numeric sorting for dataview

    John Saunders, Jul 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,700
    John Saunders
    Jul 20, 2004
  2. =?Utf-8?B?U3VuZWV0?=

    Sorting a dataview

    =?Utf-8?B?U3VuZWV0?=, Aug 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    11,971
    Duron
    Aug 10, 2004
  3. Jason

    dataview sorting in manual order?

    Jason, Sep 1, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    4,407
    Jason
    Sep 2, 2004
  4. =?Utf-8?B?TWljaGHFgiBKYW51c3pjenlr?=

    DataView data accessor aware of sorting used

    =?Utf-8?B?TWljaGHFgiBKYW51c3pjenlr?=, Nov 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    383
    =?Utf-8?B?TWljaGHFgiBKYW51c3pjenlr?=
    Nov 22, 2004
  5. CodeMonkey
    Replies:
    1
    Views:
    730
    joyal jhaveri
    Feb 4, 2011
Loading...

Share This Page