diff --git a/ServerExplorer/UI/FrmDatos.Designer.cs b/ServerExplorer/UI/FrmDatos.Designer.cs index d483218..3571b79 100644 --- a/ServerExplorer/UI/FrmDatos.Designer.cs +++ b/ServerExplorer/UI/FrmDatos.Designer.cs @@ -37,26 +37,25 @@ this.dgvDatos.AllowUserToAddRows = false; this.dgvDatos.AllowUserToDeleteRows = false; this.dgvDatos.AllowUserToOrderColumns = true; - this.dgvDatos.AllowUserToResizeRows = false; - this.dgvDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.dgvDatos.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.dgvDatos.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvDatos.Location = new System.Drawing.Point(12, 12); this.dgvDatos.Name = "dgvDatos"; this.dgvDatos.ReadOnly = true; - this.dgvDatos.RowHeadersVisible = false; this.dgvDatos.Size = new System.Drawing.Size(347, 308); this.dgvDatos.TabIndex = 0; - this.dgvDatos.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDatos_CellContentClick); + this.dgvDatos.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDatos_CellDoubleClick); + this.dgvDatos.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvDatos_CellFormatting); // - // frmDatos + // FrmDatos // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(371, 332); this.Controls.Add(this.dgvDatos); - this.Name = "frmDatos"; + this.Name = "FrmDatos"; this.Text = "frmDatos"; this.Load += new System.EventHandler(this.frmDatos_Load); ((System.ComponentModel.ISupportInitialize)(this.dgvDatos)).EndInit(); diff --git a/ServerExplorer/UI/FrmDatos.cs b/ServerExplorer/UI/FrmDatos.cs index c3bedda..362349d 100644 --- a/ServerExplorer/UI/FrmDatos.cs +++ b/ServerExplorer/UI/FrmDatos.cs @@ -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 } }