/// <summary> /// Implementation of the required IImage method /// </summary> /// <param name="cellContext">The cell for which an image is desired</param> /// <returns>The image, or null for no image</returns> public System.Drawing.Image GetImage(CellContext cellContext) { SourceGrid.DataGrid grid = (SourceGrid.DataGrid)cellContext.Grid; DataRowView row = (DataRowView)grid.Rows.IndexToDataSourceRow(cellContext.Position.Row); if (FCallerForm.EvaluateBoundImage(FCallerContext, row)) { // The caller wants the image to be displayed return(FDisplayImage); } // No image displayed return(null); }
/// <summary> /// Implementation of the required IToolTipText method /// </summary> /// <param name="cellContext">The cell for which an tool tip is desired</param> /// <returns>The text, which may be an empty string</returns> public string GetToolTipText(SourceGrid.CellContext cellContext) { SourceGrid.DataGrid grid = (SourceGrid.DataGrid)cellContext.Grid; DataRowView row = (DataRowView)grid.Rows.IndexToDataSourceRow(cellContext.Position.Row); if (row != null) { if (FCallerForm.EvaluateBoundImage(FCallerContext, row)) { // There is an image in this row/column if (FImageEnum == BoundGridImage.DisplayImageEnum.Inactive) { if (FCallerContext == BoundGridImage.AnnotationContextEnum.CostCentreCode) { return(Catalog.GetString("This Cost Centre code is no longer active")); } else if (FCallerContext == BoundGridImage.AnnotationContextEnum.AccountCode) { return(Catalog.GetString("This Bank Account code is no longer active")); } else if (FCallerContext == BoundGridImage.AnnotationContextEnum.AnalysisTypeCode) { return(Catalog.GetString("This Analysis Attribute type is no longer active")); } else if (FCallerContext == BoundGridImage.AnnotationContextEnum.AnalysisAttributeValue) { return(Catalog.GetString("This Analysis Attribute value is no longer active")); } else if (FCallerContext == BoundGridImage.AnnotationContextEnum.RetiredUser) { return(Catalog.GetString("This user has been retired")); } } } } return(string.Empty); }