FrmDatos: Evitar fallos con imágenes vacías

This commit is contained in:
2013-11-26 21:37:05 +01:00
parent b2d7fda236
commit 9940c5dcb9
2 changed files with 27 additions and 9 deletions

View File

@@ -11,6 +11,8 @@ namespace ServerExplorer.UI
{
public partial class FrmDatos : Form
{
#region Form life cycle
public FrmDatos(DataTable dt, String titulo)
{
InitializeComponent();
@@ -21,6 +23,23 @@ namespace ServerExplorer.UI
private void frmDatos_Load(object sender, EventArgs e) { }
private void dgvDatos_CellContentClick(object sender, DataGridViewCellEventArgs e) { }
#endregion
#region Events
private void dgvDatos_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { }
private void dgvDatos_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.DesiredType == typeof(Image))
{
if (e.Value is DBNull || ((byte[])e.Value).Length <= 0)
{
e.Value = new Bitmap(1, 1);
}
}
}
#endregion
}
}