I'm using a webslider with a valuetype=datetime. I have the valuelabel set to display on RightOrBottom. The valuelabel displays wrong for certain dates. The control has the correct values when access from the server so it is just a client side display problem. Below is the code to reproduce the problem. It seems any dates in Feb of 2006 don't work.
<%@ Register assembly="Infragistics35.Web.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.EditorControls" tagprefix="cc1" %>
<script runat="server">
'doesn't work
'works
'Dim startdate As New DateTime(2006, 1, 2)
'Dim enddate As New DateTime(2006, 2, 20)
'Dim startdate As New DateTime(2006, 3, 2)
'Dim enddate As New DateTime(2006, 3, 20)
Me.WebSlider1.MaxValue = enddate
End Sub
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
</head>
<body>
<form id="form1" runat="server" onload="TestWebSlider_Load">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
ValueType="DateTime">
<ValueLabel Location="RightOrBottom" />
</cc1:WebSlider>
</div>
</body>
</html>
Hi,
Default format for value-label depends on range of dates and may include/not-include, day, month, year, hours, minutes, etc. To customize it, application should process ClientEvent.FormatValueLabel.
Example below shows how to process that event, customize tickmark labels and increase width of value label.
<script type="text/javascript">function formatValue(slider, evtArgs){ var val = evtArgs.get_value(); var year = val.getFullYear() % 100; if(year < 10) year = '0' + year; var lbl = (val.getMonth() + 1) + '/' + val.getDate() + '/' + year; evtArgs.set_label(lbl);}</script>
<ig:WebSlider ID="WebSlider1" runat="server" ValueType="DateTime"> <ClientEvents FormatValueLabel="formatValue" /> <ValueLabel Location="RightOrBottom" CssClass="lbl" /> <Tickmarks LabelFormatString="M/d/yy"></Tickmarks></ig:WebSlider>
var val = evtArgs.get_value(); //this line can obtain the value for the frist slider.
If you are using dual slider how to obtain the value for the secondary slider.