From a7d4f7bdc8ff5d201adc628376221a7da0ffc3d1 Mon Sep 17 00:00:00 2001 From: APopatanasov Date: Thu, 15 Nov 2018 18:13:38 +0200 Subject: [PATCH] Remove irrelevant code that throws unexpectedly error and make the selection be possible when the ItemsControl is still not arranged. --- .../RadSegmentedControl.Selection.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Controls/Input/Input.UWP/SegmentedControl/RadSegmentedControl.Selection.cs b/Controls/Input/Input.UWP/SegmentedControl/RadSegmentedControl.Selection.cs index d740438..bbe5a05 100644 --- a/Controls/Input/Input.UWP/SegmentedControl/RadSegmentedControl.Selection.cs +++ b/Controls/Input/Input.UWP/SegmentedControl/RadSegmentedControl.Selection.cs @@ -123,16 +123,8 @@ namespace Telerik.UI.Xaml.Controls.Input } else { - try - { - throw new ArgumentException("Value does not fall within the expected range."); - } - finally - { - control.isInternalChange = true; - control.SelectedIndex = oldSelectedIndex; - control.isInternalChange = false; - } + var item = control.GetItemByIndex(selectedIndex); + control.UpdateSelectedValue(item.GetPropertyValue(control.SelectedValuePath)); } } else