The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
1. I have a grid in which I want to be able to multi-select rows. 2. I want to maintain my selection when I do a right-click on the ggc so that I can take some actions on the the selected records. 3. I also want to maintain my selection unless a certain column index are clicked. For example, if I have 5 columns, only the last two columns should toggle my selection. 4. I want to be able to right-clicked on ANY row and bring up the context menu.
I have the following settings.. this.gridGroupingControl2.TableControl.Selections.Clear(); this.gridGroupingControl2.TableOptions.AllowSelection = GridSelectionFlags.None; this.gridGroupingControl2.TableOptions.ListBoxSelectionMode = SelectionMode.MultiSimple; this.gridGroupingControl2.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;
I am handling the following event for my context menu....
if (e.Inner.MouseEventArgs.Button == MouseButtons.Right) { int row, col; Point pt = new Point(e.Inner.MouseEventArgs.X, e.Inner.MouseEventArgs.Y); if (e.TableControl.PointToRowCol(pt, out row, out col)) e.TableControl.CurrentCell.AdjustRowColIfCoveredCell(ref row, ref col);
this.contextMenu.Items.Clear(); if (contextElement is GridRecordRow) { this.contextMenu.Items.Add("Combine", null, new EventHandler(on_item_clicked)); this.contextMenu1.Show(this, this.PointToClient(Control.MousePosition)); }
}
... however, the context menu will not come up until I right-click in the CURRENT cell of the CURRENTLY selected row.
When I right click on a row that is not selected, nothing happens.
I want to be able to right click anywhere on the grid and bring up the context menu.