Datatable sorting is not working c#

khwahi9guh

New Member
i have a group of values like below pattern\[quote\] name: color: percentage:\[/quote\]i need to sort this data in desc order of percentagenow i am using data-table DefaultView sort method\[code\]//declare columnsDataTable dt = new DataTable();dt.Columns.Add("name");dt.Columns.Add("color");dt.Columns.Add("percentage");//adding rowsDataRow dr = dt.NewRow();dr["name"]="a";dr["color"]="red";dr["percentage"]="10.1";dt.Rows.Add(dr);//sortingdt.DefaultView.Sort="percentage desc";\[/code\]the problem is coming when the same number [percentage] is repeating more timesany idea where is the error?
 
Back
Top