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 have a grid control where I have enabled/disabled certain cells to basically provide a form for the user to fill in. Everything looks great.
Now I'm trying to make it so that if the user presses the tab key to naviagate around the grid it will only stop on editable cells. I have code that does this. However, I have a few cells that are a radio button with a single value and tabbing into these cells will auto select the option in the radio button, which I don't want it to.
All my navigation code does is iteratates through the cells left to right, top to bottom, until it finds an editable cell and then calls grid.CurrentCell.MoveTo(x,y) and grid.CurrentCell.ScrollInView(). This is being called in an override of the ProcessCmdKey().
Is there any property or method for preventing this auto selecting and requiring the user to either click on it with the mouse or press the space key or something?
HAhaneefm Syncfusion Team November 2, 2007 06:10 PM UTC
Hi Brian,
One way you can do this by handling the CurrentCellKeyDown event of the grid and set the e.Handled to True when Right/Left arrowkey is pressed in GridRadioButtonCell. Below is a code snippet that shows this task.
void gridCurrentCellKeyDown(object sender, KeyEventArgs e) { GridControl _ctlGrid = sender as GridControl; GridCurrentCell cc = _ctlGrid.CurrentCell;
string _strCurrentCellType = _ctlGrid.Model[cc.RowIndex, cc.ColIndex].CellType; if (_strCurrentCellType == "RadioButton") { switch (e.KeyCode) { case Keys.Right: e.Handled = true; cc.MoveRight(); break; case Keys.Left: e.Handled = true; cc.MoveLeft(); break; } } }