RadInput for ASP.NET

Increment Settings Send comments on this topic.
General Functionality > Increment Settings

Glossary Item Box

The InputIncrementSettings object is stored in the IncrementSettings property of the RadNumericTextBox or RadDateInput control. You can customize the increment behavior by setting the properties of the InputIncrementSettings object.

IncrementSettings.InterceptArrowKeys - If the InterceptArrowKeys property is set to true and the input has focus, the user can use the up/down arrow keys to increment/decrement the value - default is true

IncrementSettings.InterceptMouseWheel - If the InterceptMouseWheel property is set to true and the input has focus, the user can use the mouse wheel to increment/decrement the value - default is true

IncrementSettings.Step - incrementing by the amount specified by the Step property and approach the MaxValue/MinValue (MaxDate/MinDate for RadDateInput) - default is 1

 

The following code example allows you to change the IncrementSettings properties at run time and see how each affects the behavior of the RadNumericTextBox and RadDateInput controls.

 

C#

Example Title Copy Code
<%@ Page Language="C#" %>
<
%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<
title>Untitled Page</title>
<
script runat="server">
protected void State_Changed(object sender, EventArgs e)
{
if (RadNumericTextBox2.Value.HasValue)
this.RadDateInput1.IncrementSettings.Step = RadNumericTextBox2.Value.Value;
this.RadDateInput1.IncrementSettings.InterceptArrowKeys = CheckBox1.Checked;
this.RadDateInput1.IncrementSettings.InterceptMouseWheel = CheckBox2.Checked;
if (RadNumericTextBox2.Value.HasValue)
this.RadNumericTextBox1.IncrementSettings.Step = RadNumericTextBox2.Value.Value;
this.RadNumericTextBox1.IncrementSettings.InterceptArrowKeys = CheckBox1.Checked;
this.RadNumericTextBox1.IncrementSettings.InterceptMouseWheel = CheckBox2.Checked;
}
</script>
</
head>
<
body style="background-color: Beige;">
<
form id="form1" runat="server">
<
div>
<
asp:CheckBox Text="InterceptArrowKeys" AutoPostBack="true" ID="CheckBox1" runat="server" OnCheckedChanged="State_Changed" />
<
br />
<
asp:CheckBox Text="InterceptMouseWheel" AutoPostBack="true" ID="CheckBox2" runat="server" OnCheckedChanged="State_Changed" />
<
br />
<radI:RadNumericTextBox Value="3" MinValue="0" MaxValue="10" AutoPostBack="true" ID="RadNumericTextBox2" runat="server" OnTextChanged="State_Changed">
</
radI:RadNumericTextBox> Step
<br />
<
hr />
<radI:RadNumericTextBox Value="5" Skin="Vista" ID="RadNumericTextBox1" runat="server">
<
IncrementSettings Step="3" InterceptArrowKeys="false" InterceptMouseWheel="false" />
</
radI:RadNumericTextBox> RadNumericTextBox
<p></p>
<
radI:RadDateInput SelectedDate="10/10/2005" Skin="Vista" ID="RadDateInput1" runat="server">
<
IncrementSettings Step="3" InterceptMouseWheel="False" InterceptArrowKeys="false" />
</radI:RadDateInput> RadDateInput
</div>
</
form>
</
body>
</
html>


 VB

Example Title Copy Code
<%@ Page Language="VB" %>
<
%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<
title>Untitled Page</title>
<
script runat="server">
Protected Sub Changed(ByVal sender As Object, ByVal e As System.EventArgs)
If RadNumericTextBox2.Value.HasValue Then
RadDateInput1.IncrementSettings.Step = RadNumericTextBox2.Value.Value
End If
RadDateInput1.IncrementSettings.InterceptArrowKeys = CheckBox1.Checked
RadDateInput1.IncrementSettings.InterceptMouseWheel = CheckBox2.Checked
If RadNumericTextBox2.Value.HasValue Then
RadNumericTextBox1.IncrementSettings.Step = RadNumericTextBox2.Value.Value
End If
RadNumericTextBox1.IncrementSettings.InterceptArrowKeys = CheckBox1.Checked
RadNumericTextBox1.IncrementSettings.InterceptMouseWheel = CheckBox2.Checked
End Sub
</script>
</
head>
<
body>
<
form id="form1" runat="server">
<
div>
<
asp:CheckBox OnCheckedChanged="Changed" Text="InterceptArrowKeys" AutoPostBack="true" ID="CheckBox1" runat="server" />
<
br />
<
asp:CheckBox OnCheckedChanged="Changed" Text="InterceptMouseWheel" AutoPostBack="true" ID="CheckBox2" runat="server" />
<
br />
<radI:RadNumericTextBox OnTextChanged="Changed" Value="3" MinValue="0" MaxValue="10" AutoPostBack="true" ID="RadNumericTextBox2" runat="server" >
</
radI:RadNumericTextBox> Step
<br />
<
hr />
<radI:RadNumericTextBox Value="5" Skin="Vista" ID="RadNumericTextBox1" runat="server">
<
IncrementSettings Step="3" InterceptArrowKeys="false" InterceptMouseWheel="false" />
</
radI:RadNumericTextBox> RadNumericTextBox
<p></p>
<
radI:RadDateInput SelectedDate="10/10/2005" Skin="Vista" ID="RadDateInput1" runat="server">
<
IncrementSettings Step="3" InterceptMouseWheel="False" InterceptArrowKeys="false" />
</radI:RadDateInput> RadDateInput
</div>
</
form>
</
body>
</
html>