/// <summary> /// Handles the ItemClick event of the ucDataGridView1 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> void ucDataGridView1_ItemClick(object sender, DataGridViewEventArgs e) { if (ItemClick != null) { ItemClick((sender as IDataGridViewRow).DataSource, null); } }
/// <summary> /// Rows the source changed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> void RowSourceChanged(object sender, DataGridViewEventArgs e) { if (RowSourceChangedEvent != null) { RowSourceChangedEvent(sender, e); } }
/// <summary> /// Sets the select row. /// </summary> /// <param name="item">The item.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> private void SetSelectRow(Control item, DataGridViewEventArgs e) { try { ControlHelper.FreezeControl(this, true); if (item == null) { return; } if (item.Visible == false) { return; } this.FindForm().ActiveControl = this; this.FindForm().ActiveControl = item; if (m_selectRow != item) { if (m_selectRow != null) { m_selectRow.SetSelect(false); } m_selectRow = item as IDataGridViewRow; m_selectRow.SetSelect(true); if (this.panRow.Controls.Count > 0) { if (item.Location.Y < 0) { this.panRow.AutoScrollPosition = new Point(0, Math.Abs(this.panRow.Controls[this.panRow.Controls.Count - 1].Location.Y) + item.Location.Y); } else if (item.Location.Y + m_rowHeight > this.panRow.Height) { this.panRow.AutoScrollPosition = new Point(0, Math.Abs(this.panRow.AutoScrollPosition.Y) + item.Location.Y - this.panRow.Height + m_rowHeight); } } } if (ItemClick != null) { ItemClick(item, e); } } finally { ControlHelper.FreezeControl(this, false); } }
/// <summary> /// Handles the ItemClick event of the m_ucPanel control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param> void m_ucPanel_ItemClick(object sender, DataGridViewEventArgs e) { _frmAnchor.Hide(); SelectSource = sender; }