/// <summary> /// 构造函数。 /// </summary> public ColPivotInfo(string fieldName) { _FieldName = fieldName; _CellFormat = DevExpress.Utils.FormatInfo.Empty; _ValueFormat = DevExpress.Utils.FormatInfo.Empty; }
internal void SetEditFormat(DevExpress.Utils.FormatInfo pFormatInfo) { switch (this.DataType) { case BoDataType.dt_LONG_NUMBER: case BoDataType.dt_SHORT_NUMBER: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "f0"; break; case BoDataType.dt_QUANTITY: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "n" + this.DecimalPlaces.ToString( ); break; case BoDataType.dt_PRICE: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "n" + this.DecimalPlaces.ToString( ); break; case BoDataType.dt_RATE: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "n" + this.DecimalPlaces.ToString( ); break; case BoDataType.dt_MEASURE: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "n" + this.DecimalPlaces.ToString( ); break; case BoDataType.dt_SUM: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "n" + this.DecimalPlaces.ToString( ); break; case BoDataType.dt_PERCENT: pFormatInfo.FormatType = DevExpress.Utils.FormatType.Numeric; pFormatInfo.FormatString = "n" + this.DecimalPlaces.ToString( ); break; case BoDataType.dt_LONG_TEXT: break; case BoDataType.dt_SHORT_TEXT: break; case BoDataType.dt_DATE: pFormatInfo.FormatType = DevExpress.Utils.FormatType.DateTime; pFormatInfo.FormatString = "d"; break; default: pFormatInfo.FormatType = DevExpress.Utils.FormatType.None; pFormatInfo.FormatString = String.Empty; break; } }
public override string GetDisplayText(DevExpress.Utils.FormatInfo format, object editValue) { string _txt = format.GetDisplayText(editValue); if (_txt.Length == 0) { return string.Format("{0}", editValue); } return _txt; }
public override string GetDisplayText(DevExpress.Utils.FormatInfo format, object editValue) { if (editValue != null && (editValue as Font) != null) { return(String.Format("{0}, {1}", (editValue as Font).Name, (editValue as Font).Size)); } else { return(base.GetDisplayText(format, editValue)); } }
public override string GetDisplayText(DevExpress.Utils.FormatInfo format, object editValue) { string displayText = string.Empty; if (this.IsBoundMode) { displayText = this.GetDisplayText(editValue, true); } else { displayText = this.GetDisplayText(editValue, false); } DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e = new DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs(editValue, base.GetDisplayText(format, editValue)); if (format != this.EditFormat) { this.RaiseCustomDisplayText(e); } return(displayText); }
//设置用户配置的显示格式信息。 private void setFormatData(XmlNodeList nodeList, XWinLib.PivotGrid.ColPivotInfo info) { foreach (XmlNode node in nodeList) { if (node.NodeType != XmlNodeType.Element) { continue; } if (string.Compare(node.Name, "DisplayFormat", true) != 0) { continue; } DevExpress.Utils.FormatInfo cell = new DevExpress.Utils.FormatInfo(); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.NodeType != XmlNodeType.Element) { continue; } if (string.Compare(childNode.Name, "FormatType", true) == 0) { cell.FormatType = (DevExpress.Utils.FormatType)Enum.Parse(typeof(DevExpress.Utils.FormatType), childNode.InnerText.Trim()); } else if (string.Compare(childNode.Name, "FormatString", true) == 0) { cell.FormatString = childNode.InnerText.Trim(); } else { continue; } } info.CellFormat = cell; info.ValueFormat = cell; } }
public override string GetDisplayText(DevExpress.Utils.FormatInfo format, object editValue) { return(""); }
public override string GetDisplayText(DevExpress.Utils.FormatInfo format, object editValue) { return(editValue != null?Path.GetFileName(editValue.ToString()) : ""); }