Hi
I am using the XamWebDateTimeRangeSlider and setting the min and max values of the slider dynamically.For some reason _slider.MinValue doesnot get updated (stores the previous value) with the recent value though I get the value at minvalue.AddHours(-23) .I am posting my code can somebody please help me with that.
public
void SelectedValues(DateTime minvalue, DateTime maxvalue)
{
if
(minvalue == maxvalue)
_slider.MinValue = minvalue.AddHours(-23);
_slider.MaxValue = minvalue;
Infragistics.Silverlight.
FrequencyType type = (Infragistics.Silverlight.FrequencyType)Enum.Parse(typeof(Infragistics.Silverlight.FrequencyType), "Hours", true);
tickType = type;
foreach (DateTimeSliderTickMarks tick in _slider.TickMarks)
tick.FrequencyType = type;
}
xaml
<
="White">
="map">
="Stretch" >
}" />
="3" />
="_slider_ThumbValueChanged">
>
="Transparent" />
}"/>
DataTemplate x:Key="HorizontalLabels">
<StackPanel>
<Rectangle Width="2" Height="6" Fill="White" VerticalAlignment="Top" Margin="0,6,0,0"/>
<TextBlock x:Name="Labels" Loaded="TextBlock_Loaded" Tag="{Binding}" TextWrapping="NoWrap" Foreground="White" Margin="0,4,0,0"/>
</StackPanel>
</DataTemplate>
Hi,
Did you try with 10.2 version:
The sample that i did works good:
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="170"/>
<RowDefinition Height="30"/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Grid x:Name="CalendarGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<basics:Calendar x:Name="startCalendar" SelectedDate="8/1/2010" HorizontalAlignment="Right"/>
<basics:Calendar Grid.Column="1" x:Name="endCalendar" SelectedDate="8/4/2010" HorizontalAlignment="Right"/>
</Grid>
<Grid Grid.Row="1">
<sdk:Label Content="Min:"/>
<TextBox x:Name="TxtMin" Grid.Column="1" Text="{Binding MinValue, ElementName=_slider}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<sdk:Label Grid.Column="2" Content="Max:"/>
<TextBox x:Name="TxtMax" Grid.Column="3" Text="{Binding MaxValue, ElementName=_slider}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Button Grid.Row="2" x:Name="BtnSetMinMax" Content="Set Min Max" Click="BtnSetMinMax_Click"/>
<Grid x:Name="_slidergrid" Grid.Row="3" VerticalAlignment="Bottom" Margin="10,0,10,20" Height="40" HorizontalAlignment="Stretch" >
<Rectangle StrokeThickness="0" Fill="Gray" RadiusX="15" RadiusY="15" Grid.ColumnSpan="3" />
<Border BorderThickness="1,1,0,0" CornerRadius="15" BorderBrush="Red" Grid.ColumnSpan="3" />
<igSlider:XamDateTimeRangeSlider MinValue="8/1/2010" MaxValue="8/4/2010" x:Name="_slider" VerticalAlignment="Center" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" ThumbValueChanged ="_slider_ThumbValueChanged">
<igSlider:XamDateTimeRangeSlider.TickMarks>
<igSlider:DateTimeSliderTickMarks FrequencyType="Hours" TickMarksFrequency="4" IncludeSliderEnds="True"/>
</igSlider:XamDateTimeRangeSlider.TickMarks>
</igSlider:XamDateTimeRangeSlider>
private void BtnSetMinMax_Click(object sender, RoutedEventArgs e)
if(startCalendar.SelectedDate == null || endCalendar.SelectedDate == null)
return;
DateTime minvalue = (DateTime) startCalendar.SelectedDate;
DateTime maxvalue = (DateTime) endCalendar.SelectedDate;
DateTime minvalue1 = _slider.MinValue;
DateTime maxvalue2 = _slider.MaxValue;
if(minvalue == maxvalue)
else
_slider.MinValue = minvalue;
_slider.MaxValue = maxvalue;
Best!
Mihail