void ltl_DataBinding(object sender, EventArgs e) { Literal ltl = sender as Literal; object dataitem = DataBinder.GetDataItem(ltl.NamingContainer); IUxConvert uxConvert = UxConvertFactory.GetConvert(Column); if (uxConvert != null) { ltl.Text = uxConvert.GetText(dataitem, Column); } }
public static IUxConvert GetConvert(ColumnInfo columnInfo) { string convertKey = GetConvertCacheKey(columnInfo.ConvertType); IUxConvert convert = AppCtx.Cache.RetrieveObject <IUxConvert>(convertKey); if (convert == null && ModelConfig.ColumnConvert != null) { columnInfo.ConvertType = String.IsNullOrEmpty(columnInfo.ConvertType) ? "" : columnInfo.ConvertType; string convertType = ModelConfig.ColumnConvert[columnInfo.ConvertType]; convert = Utils.CreateInstance <IUxConvert>(convertType); AppCtx.Cache.AddObjectWithFileChange(convertKey, convert, ModelConfig.ConfigFilePath); } return(convert); }