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.
I want right-click behavior just like Excel - when you right click within the selection, neither the current cell nor the selection will change, just a pop-up will appear. However when you right-click outside the selection, it should select the cell under the cursor and also make it active. I have a grid with ExcelLikeCurrentCell set to true, and hte following right-click handler:
private void grid_MouseDown(object sender, MouseEventArgs e)
{
if ( e.Button == MouseButtons.Right )
{
GridRangeInfo clickedRange = grid.PointToRangeInfo(new Point(e.X,e.Y));
bool clickedInSelection = false;
if ( clickedRange != null )
{
foreach ( GridRangeInfo info in grid.Selections.Ranges )
{
if ( info.IntersectsWith(clickedRange) )
{
clickedInSelection = true;
break;
}
}
if ( !clickedInSelection )
{
grid.Selections.Clear(true);
grid.Selections.SelectRange(clickedRange, true);
grid.CurrentCell.Activate(clickedRange.Top, clickedRange.Left, GridSetCurrentCellOptions.SetFocus);
}
}
}
}
Also I have a Syncfusion XPMenu popup tied to the grid. However when I right-click outside the selection, it changes the selection but doesnt appear to change the current cell also. How can I get it to do this?
Thanks - Daniel