public static void SetDataGridViewCellImage(DataGridViewImageCell imageCell, ValueImage valueImage) { if (!EAppRuntime.Instance.CurrentApp.ResourceManagers.ContainsKey(valueImage.ResourceManagerName)) { return; } imageCell.Value = EAppRuntime.Instance.CurrentApp.ResourceManagers[valueImage.ResourceManagerName].GetImage(valueImage.ImageName); }
public static Image GetResourceImage(ValueImage valueImage) { if (!EAppRuntime.Instance.CurrentApp.ResourceManagers.ContainsKey(valueImage.ResourceManagerName)) { return(null); } return(EAppRuntime.Instance.CurrentApp.ResourceManagers[valueImage.ResourceManagerName].GetImage(valueImage.ImageName)); }
protected virtual void BindDataGridViewCellData(GridViewCostCellDetail costCellDetail, DataGridViewCellValueEventArgs e) { //display cell value depend on the enum value of the property ValueType switch (costCellDetail.ValueType) { case GridViewCellValueType.Boolean: e.Value = costCellDetail.GetValue <bool>(); break; case GridViewCellValueType.DateTime: e.Value = costCellDetail.DisplayValue; // may be need to format break; case GridViewCellValueType.Decimal: e.Value = costCellDetail.DisplayValue; // may be need to format break; case GridViewCellValueType.Integer: this.SetDataGridViewCellValue(costCellDetail, e); break; case GridViewCellValueType.Percentage: e.Value = costCellDetail.DisplayValue; break; case GridViewCellValueType.String: this.SetDataGridViewCellValue(costCellDetail, e); break; case GridViewCellValueType.Icon: ValueImage valueImage = costCellDetail.GetValue <ValueImage>(); e.Value = XpressCommonHelper.GetResourceImage(valueImage); break; default: break; } }