This is a migrated thread and some comments may be shown as answers.

mouse wheel changes cell value

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 27 Sep 2016, 07:15 PM
When editing a cell, moving the mouse wheel changes the value of the cell. How can I stop this behavior?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Sep 2016, 12:43 PM
Hello Daniel,

The increment settings are enabled by default for better convenience with operating with the input control. You can access the control and disable the arrow navigation of the numbox itself using the approach demonstrated in the following section:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-batch-edit-mode


In this case it will be something like this:
Copy Code
Copy Code
Copy Code
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    GridTableView masterTable = ((RadGrid)sender).MasterTableView;
    GridNumericColumnEditor editor = masterTable.GetBatchColumnEditor("Freight") as GridNumericColumnEditor;
    RadNumericTextBox numBox = editor.NumericTextBox;
    numBox.IncrementSettings.InterceptArrowKeys = false;
    numBox.IncrementSettings.InterceptMouseWheel = false;
}

An alternative approach is the following:
Copy Code
Copy Code
Copy Code
<telerik:GridNumericColumn ... ColumnEditorID="NumBoxEditor1">

Editor definition on the same page with the RadGrid:
Copy Code
Copy Code
Copy Code
<telerik:GridNumericColumnEditor runat="server" ID="NumBoxEditor1">
    <NumericTextBox runat="server">
        <IncrementSettings InterceptArrowKeys="false" InterceptMouseWheel="false" />
    </NumericTextBox>
</telerik:GridNumericColumnEditor>

I hope this will prove helpful.


Regards,
Eyup
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or