Skip to content

Dataview sorting

vipin saini

Asked Oct 7, 2010, 3:55 AM EDT3 answers
Share
LinkedInX
Hi ,
i want to sort dataview according to the price format(24444.50) in acesending order. please tell me the solution. i am using
dataview.sort="price asc";
but it is sort in string format and i want price format.
give me reply as soon as possible.

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
    can you place the code your using...
    0
  • 0
    DataTable clone = new DataTable();
    DataView dv;
    public StringReader sr;
    public DataSet ds2;
    sr = new StringReader(ab);
    ds2 = new DataSet();
    ds2.ReadXml(sr);
    clone = null;
    dv = ds2.Tables[13].DefaultView;
    dv.Sort = "Amount Asc";
    clone = dv.ToTable();
    0
  • Suthish Nair
    0
    DataView sorts based upon string representation of your data.
    you need to dynamically create a datatable with Amount column of Number/int DataType and add rows.
    0