public override Rectangle DrawGridErrorGlyph(RenderContext context,
Rectangle cellRect,
PaletteState state,
bool rtl)
{
Debug.Assert(context != null);
// Get the appropriate each to draw
Image errorImage = _gridErrorIcon.Images[0];
// Is there enough room to draw the image?
if ((errorImage.Width < cellRect.Width) && (errorImage.Height < cellRect.Height))
{
// Find the drawing location of the image
int y = cellRect.Top + (cellRect.Height - errorImage.Height) / 2;
int x = (rtl ? cellRect.Left : cellRect.Right - errorImage.Width);
if (state == PaletteState.Disabled)
ControlPaint.DrawImageDisabled(context.Graphics, errorImage, x, y, Color.Empty);
else
context.Graphics.DrawImage(errorImage, x, y);
// Reduce the cell rect by that used up
cellRect.Width -= errorImage.Width;
// With rtl we need to move across to the right
if (rtl)
cellRect.X += errorImage.Width;
}
return cellRect;
}