protected void RowClicked(int i, object item) { SelectedRow = i; if (OnRowClicked != null) { OnRowClicked.Invoke(item); } }
protected void RowClicked(int i, object item) { _selectedRow = i; if (OnRowClicked != null) { OnRowClicked.Invoke(item); } StateHasChanged(); }
public async Task RowClicked(Item item) { if (!ShowCheckboxes) { await SetSelectedItem(item); } await OnRowClicked.InvokeAsync(item); }
private void gridView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Left) { _mouseDownOrderID = 0; _mouseDownHit = gridView1.CalcHitInfo(new Point(e.X, e.Y)); if (_mouseDownHit.InDataRow) { Lvl2TableObj selected = _bindingList[gridView1.GetDataSourceRowIndex(_mouseDownHit.RowHandle)]; if (_mouseDownHit.Column.Caption.Equals("Exch") && (selected.IsOurOrder)) { _mouseDownOrderID = selected.OrderID; } OnRowClicked?.Invoke(selected.Exch, selected.Price, selected.Size); } } }
internal void RowClicked(int i, object item, MouseEventArgs args) { //If user clicked on a row withouth Control key, unselect all rows if ((Grid.ModifierKey == ModifierKey.CtrlKey && !args.CtrlKey) || (Grid.ModifierKey == ModifierKey.AltKey && !args.AltKey) || (Grid.ModifierKey == ModifierKey.ShiftKey && !args.ShiftKey) || (Grid.ModifierKey == ModifierKey.MetaKey && !args.MetaKey)) { SelectedRows.Clear(); Grid.SelectedItems = new List <object>(); } //If Grid is MultiSelectable, add selected row to list of rows if (Grid.ComponentOptions.MultiSelectable) { SelectedRow = -1; //If selected row is already part of collection, remove it if (SelectedRows.Contains(i)) { SelectedRows.Remove(i); Grid.SelectedItems = Grid.SelectedItems.Except(new[] { item }); } else { SelectedRows.Add(i); Grid.SelectedItems = Grid.SelectedItems.Concat(new[] { item }); } } else { SelectedRow = i; Grid.SelectedItems = Grid.SelectedItems.Concat(new[] { item }); } if (OnRowClicked != null) { OnRowClicked.Invoke(item); } _shouldRender = true; StateHasChanged(); }