0
在我的應用程序中使用組件flexgrid工具從我的sql服務器使用Linq綁定大量數據,但網格顯示我的實體列表中的所有列,而不是我爲我的flexgrid初始化的列。 我想只有三個coloumns從中ITEMNAME,PARTNO,Itemcode, * Thease coloums僅第一初始化* 但表明我不想永遠 如何停止自動生成Flexgrid中的列
List NewList = new List(); Itlist = objItemMgmt.GetItms(Convert.ToString(gvPurchaseEntry1.Cols[d].Index.ToString()));//d is ["ItemCode"] gvPurcahseItems1.DataSource = Itlist; gvPurcahseItems1.Focus();
這裏所有Coloums是我的實體數據列表
public List GetItms(string itemName) { var reslt = (from itm in context.ItemMasters join mm in context.MultiMasters on itm.ItemId equals mm.ItemId join gt in context.GoodsDetails on itm.GoodsId equals gt.GoodsId join mu in context.Multiunits on mm.MultiunitId equals mu.MultiunitId join u in context.UnitDetails on mu.UnitId equals u.UnitId join s in context.StockDetails on itm.ItemId equals s.ItemId where (itemName == null || itm.ItemName.Contains(itemName)) || (itemName == null || itm.PartNo.Contains(itemName)) || (itemName == null || itm.ItemCode.Contains(itemName)) || //(itemName == null || itm.ArabicDescription.Contains(itemName)) || (itemName == null || (itm.GoodsDetail.GoodsType + " " + itm.GoodsDetail.GroupCatagory).Contains(itemName) && (itm.StatusId != 3)) && (itm.StatusId != 3) //where ((itemName == null) || itm.ItemName.Contains(itemName) //|| itm.ItemCode.Contains(itemName) || itm.OEMNo.Contains(itemName) //|| (itm.GoodsDetail.GoodsType + " " + itm.GoodsDetail.GroupCatagory).Contains(itemName) || itm.PartNo.Contains(itemName)) //&& itm.StatusId != 3 select new Entity.ItemMasterProp { Id = (int)itm.ItemId, PartNo=(string)itm.PartNo, ItemCode = (string)itm.ItemCode, ItemName = (string)itm.ItemName, Stock = (double)s.AvailableStock, WPrice = (decimal)mm.WPrice, RPrice = (decimal)mm.RetPrice, value = (decimal)mm.Value, UnitId = (int)u.UnitId, UnitName = (string)u.UnitName, UnitCode = (string)u.UnitCode, MultiUnitId = (int)mu.MultiunitId, MultiUnitName = (string)mu.MultiName, MultiUnitCode = (string)mu.MultiCode, GoodTyp=(string)gt.GoodsType + " " + (string)gt.GroupCatagory, GoodId = (int)gt.GoodsId //GoodCatogory = (string)gt.GroupCatagory }).Distinct().ToList(); var reslt1 = (from itm in context.ItemMasters join u1 in context.UnitDetails on itm.UnitId equals u1.UnitId join gt in context.GoodsDetails on itm.GoodsId equals gt.GoodsId join s in context.StockDetails on itm.ItemId equals s.ItemId where (itemName == null || itm.ItemName.Contains(itemName)) || (itemName == null || itm.PartNo.Contains(itemName)) || (itemName == null) || itm.ItemCode.Contains(itemName) || (itemName == null || (itm.GoodsDetail.GoodsType + " " + itm.GoodsDetail.GroupCatagory).Contains(itemName) && (itm.StatusId != 3)) select new Entity.ItemMasterProp { Id = (int)itm.ItemId, PartNo = (string)itm.PartNo, ItemCode = (string)itm.ItemCode, ItemName = (string)itm.ItemName, Stock = (double)s.AvailableStock, UnitId = (int)u1.UnitId, UnitName = (string)u1.UnitName, WPrice = (decimal)itm.WPrice, RPrice = (decimal)itm.RPrice, MultiUnitName = (string)u1.UnitName, value = (decimal)1, GoodTyp = (string)gt.GoodsType + " " + (string)gt.GroupCatagory, GoodId=(int)gt.GoodsId, //GoodCatogory = (string)gt.GroupCatagory }).Distinct().ToList(); reslt = reslt.Concat(reslt1).Distinct().ToList(); return reslt; }
我想只有三個coloumns從中ITEMNAME,PARTNO,Itemcode, * Thease coloums只有首先初始化* 但顯示所有Coloums,我不想永遠
由於提前
您是否嘗試過'欄任務menu'或「C1FlexGrid列編輯器」? – 2011-03-31 13:36:04
已嘗試Column Tasks菜單,讓我試一試C1FlexGrid列編輯器, – Majid 2011-03-31 13:48:27
這兩個列任務菜單C1FlexGrid列編輯器都綁定後出現同樣的問題 – Majid 2011-03-31 13:58:35