這是類:如何在GridControl C#中整數和字符串排序?這是我的代碼:
public static List<MasterReject> GetData()
{
var context = new FingerScanContext();
return (from a in context.MasterRejects
select a).ToList();
}
這就是我所謂的網格視圖:
InitializeComponent();
List<MasterReject> mrj = new List<MasterReject>();
gridView2.OptionsBehavior.Editable = false;
mrj = MasterReject.GetData();
gridView.DataSource = mrj;
searchLookItem.Properties.DisplayMember = "ItemName";
searchLookItem.Properties.ValueMember = "ItemID";
你想排序GridView頁? – 2015-03-13 06:56:52
我希望我可以告訴你的截圖,但由於即時通訊新我不能..我只能張貼代碼..所以有一個名爲「字符」 A11 A1 A2 但我的GridView的列(分類之後)成爲: A1 A11 A2 ,但我想排序是這樣的: A1 A2 A11 – 2015-03-13 07:07:41
如果我理解你正確,你需要自然排序[這裏是鏈接到如何做到這一點(HTTP:/ /www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting) – 2015-03-13 07:47:10