Approved
Last Updated: 06 Sep 2017 14:27 by ADMIN
ADMIN
Angel Petrov
Created on: 15 May 2014 06:54
Category: InputManager
Type: Feature Request
3
IMPROVE: The auto-correcting capabilities of the RadNumericTextBox when the MaxValue and MinValue properties are changed on the client.
Currently if the MinValue or MaxValue properties are changed on the client, on the server the numeric value is auto-corrected according to the their old value.

Disabling the ViewState can help. Here is a basic example that can be used:

		<telerik:RadNumericTextBox runat="server" ID="rtb1" EnableViewState="false"></telerik:RadNumericTextBox>
		<asp:Button ID="Button1" Text="1 change max value and value with JS" OnClientClick="changeValues(); return false;" runat="server" />
		<asp:Button ID="Button2" Text="2 postback" OnClick="Button2_Click" runat="server" />
		<script>
			function changeValues() {
				var rtb = $find("<%=rtb1.ClientID%>");
				rtb.set_maxValue(100);
				rtb.set_value(100);
			}
		</script>

	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			rtb1.MaxValue = 20;
			rtb1.Value = 1;
		}
	}
	protected void Button2_Click(object sender, EventArgs e)
	{
		Response.Write(string.Format("currValue: {0}<br/> maxValue: {1}", rtb1.Value, rtb1.MaxValue));
	}
3 comments
ADMIN
Marin Bratanov
Posted on: 06 Sep 2017 14:27
Setting the server property from the client-side setter is not implemented. By default an exception is not thrown, the server code merely uses the server value for the MaxValue to compare the Value against first during state loading.
Greg
Posted on: 06 Sep 2017 13:28
I disagree that throwing an exception when calling set_maxValue on the client is an acceptable solution because set_maxValue is a documented function that is expected to work correctly and be honored across client/server calls. I'm also somewhat surprised this is a feature request because it smells like a bug.
Dan
Posted on: 13 Apr 2015 16:16
Yes, this needs to change.  You can currently set the min/max values on the client side and once you do a postback they are then set immutably on the controls at the server side so that subsequent client side adjustments are ignored.  The client side setter should at least throw an error if the server side value is going to be immutable.