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

Disable Mouse Scroll of GridNumericColumn in EditMode=Batch, EditType=Cell

4 Answers 296 Views
Grid
This is a migrated thread and some comments may be shown as answers.
IT Support
Top achievements
Rank 1
IT Support asked on 06 Aug 2014, 04:09 PM
How can I stop the mouse scroll wheel incrementing and decrementing the values of a GridNumericColumn in my Radrgrid when EditMode="Batch" and EditType="Cell"?

This post suggests using ItemDataBound: http://www.telerik.com/forums/gridnumericcolumn-edit-control
However if I step into the debugger the code:
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
is never True

Hope you can help?

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Aug 2014, 04:24 AM
Hi Mark,

You can use the GridNumericColumnEditor to control the cell in edit mode. Please try the following code snippet.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server">
    <MasterTableView  EditMode="Batch">
        <BatchEditingSettings EditType="Cell" />
        <Columns>          
            <telerik:GridNumericColumn UniqueName="Freight" HeaderText="Freight" DataField="Freight" ColumnEditorID="FreightColumnEditor">
            </telerik:GridNumericColumn>        
        </Columns>
    </MasterTableView>   
</telerik:RadGrid>
<telerik:GridNumericColumnEditor ID="FreightColumnEditor" runat="server"
 NumericTextBox-IncrementSettings-InterceptMouseWheel="false" >
</telerik:GridNumericColumnEditor>

Thanks,
Princy
0
Angel Petrov
Telerik team
answered on 11 Aug 2014, 10:48 AM
Hi Mark,

Another option for you would be obtain a reference to the RadNumericTextBox rendered as an editor for that column and set the InterceptMouseWheel property to false.

ASPX:
<Columns>
                   <telerik:GridNumericColumn UniqueName="Freight" DataField="Freight"></telerik:GridNumericColumn>
               </Columns>

C#:
protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        RadNumericTextBox numericEditor = (RadGrid1.MasterTableView.GetBatchColumnEditor("Freight") as GridNumericColumnEditor).NumericTextBox;
        numericEditor.IncrementSettings.InterceptMouseWheel = false;
    }


Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jeffrey
Top achievements
Rank 1
answered on 09 Jan 2019, 10:17 PM

I get the message Telerik.Web.UI.GridException: GridTableView.GetBatchColumnEditor method could be used only when EditMode is set to batch.

Any advise?

0
Eyup
Telerik team
answered on 14 Jan 2019, 06:46 AM
Hi Jeffrey,

Batch editing mode is one of the edit modes provided by RadGrid and it can be enabled using the EditMode property of the MasterTableView tag:
https://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

You can check the following resource to see how you can disable arrow key and scroll navigation in the inner controls when using Batch editing:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/prevent-numeric-value-changing-with-batch-editing-when-using-keyboard-navigation-with-the-arrow-keys

I am also sending a sample RadGrid web site.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
IT Support
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Angel Petrov
Telerik team
Jeffrey
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or