FrmDatos: Evitar fallos con imágenes vacías
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user