/// <summary> /// Handles row selection on click, if the list latter is selectable. /// </summary> /// <param name="row">The row that was clicked.</param> protected virtual async Task RowClickedAsync(DataRow row) { if (SelectableClass != "") { if (RowSelected.HasDelegate) { await RowSelected.InvokeAsync(row); } else { List?.ToggleSelection(row); } } }
/// <summary> /// 鼠标单击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnMouseClick(object sender, MouseEventArgs e) { if (_DragStartLocation != Point.Empty && e.X != _DragStartLocation.X && _DragStartLocation.Y != e.Y) { return; } if (IsHoverRowHeader(e.Location) || IsHoverRow(e.Location)) { _SelectionRow = GetRow(e.Location); Invalidate(); RowSelected?.Invoke(this, new GanttChartRowSelectedEventArgs(_SelectionRow)); } if (IsHoverItem(e.Location)) { _SelectionItem = GetItem(e.Location); Invalidate(); ItemClick?.Invoke(this, new GanttChartItemClickEventArgs(_SelectionItem)); } }
private void SelectRow(ControlBase control, bool clearOthers = false) { if (!AllowMultiSelect || clearOthers) { UnselectAll(); } ListBoxRow row = control as ListBoxRow; if (row == null) { return; } row.IsSelected = true; m_SelectedRows.Add(row); if (RowSelected != null) { RowSelected.Invoke(this, new ItemSelectedEventArgs(row)); } }
/// <summary> /// Slelects the specified row. /// </summary> /// <param name="control">Row to select.</param> /// <param name="clearOthers">Determines whether to deselect previously selected rows.</param> public void SelectRow(Control control, bool clearOthers = false) { if (!AllowMultiSelect || clearOthers) { UnselectAll(); } ListBoxRow row = control as ListBoxRow; if (row == null) { return; } // TODO: make sure this is one of our rows! row.IsSelected = true; m_SelectedRows.Add(row); if (RowSelected != null) { RowSelected.Invoke(this); } }
protected virtual void OnRowSelected(EventArgs e) { RowSelected?.Invoke(this, e); }
/// <summary> /// 选择行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvEntity_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { RowSelected?.Invoke(sender, e); }
public void SendRowSelected(Node node) { RowSelected?.Invoke(this, new NodeEventArgs(node)); }
protected void gvOrders_SelectedIndexChanged(object sender, EventArgs e) { RowSelected?.Invoke(this, EventArgs.Empty); }