public ChargeApplyForm(OrderEntity order ) : this() { GridItem dgi1 = new GridItem(); GridItem dgi2 = new GridItem(); GridItem dgi3 = new GridItem(); GridItem dgi4 = new GridItem(); GridItem dgi5 = new GridItem(); AGrid.Items.Add(dgi1); AGrid.Items.Add(dgi2); AGrid.Items.Add(dgi3); AGrid.Items.Add(dgi4); AGrid.Items.Add(dgi5); dgi1.PropertyDisplayName = "单据编号"; dgi1.PropertyName = "OrderCode"; dgi1.Width = 75; dgi2.PropertyDisplayName = "单据类型"; dgi2.PropertyName = "OrderType"; dgi2.Width = 75; dgi3.PropertyDisplayName = "状态"; dgi3.PropertyName = "OrderStates"; dgi3.Width = 75; dgi4.PropertyDisplayName = "申请人"; dgi4.PropertyName = "Applicant"; dgi4.Width = 75; dgi5.PropertyDisplayName = "申请部门"; dgi5.PropertyName = "AppliedDepartMent"; dgi5.Width = 75; AGrid.InitGrid(); }
private List<GridItem> GetDataGridItem(List<string[]> ItemInfo) { List<GridItem> items = new List<GridItem>(); for (int i = 0; i < ItemInfo.Count; i++) { GridItem dgi = new GridItem(); dgi.PropertyDisplayName = ItemInfo[i][0]; dgi.PropertyName = ItemInfo[i][1]; dgi.Width = float.Parse(ItemInfo[i][2]); dgi.IsReadOnly = Convert.ToBoolean(int.Parse(ItemInfo[i][3])); items.Add(dgi); } return items; }
private static List<GridItem> GetGridItem(XElement xElement) { xElement = xElement.Element("GridItems"); List<GridItem> list = new List<GridItem>(); foreach (XElement xeItem in xElement.Elements("GridItem")) { GridItem gridItem = new GridItem(); XMLHelper.SetValue(gridItem, xeItem); list.Add(gridItem); XElement xeISource = xeItem.Element("ReferencedData"); if (xeISource != null) { string rType = xeISource.Attribute("Type").Value; string rDefaultValue = GetValue(xeISource, "DefaultValue"); ReferencedDataInfo r = new ReferencedDataInfo(); r.Type = rType; r.DefaultValue = rDefaultValue; r.ReferencedMember = gridItem.PropertyName; gridItem.ReferenceDataInfo = r; } } return list; }