Telerik Forums
UI for WPF Forum
3 answers
172 views
Hi

[reproduce and phenomenon]
Bind the RadSlider's SelectionStart/SelectionEnd to Application's DependencyProperty.
When Slider's Thumb is dragged out of the control, values which exceed Minimum/Maximum
Property are substituted into the Property.

This problem did not occur in the Q1 2011.
 
If there is any way to avoid the above phenomenon, please let me know.

  • RadControl for WPF (Version: 2011.2.712.40)
  • OS:Windows7 Ultimate 64 bit
  • VisualStudio 2010 SP1

[VS Project]
RadSliderTest Project

[XAML]
<Window
    x:Class="RadSliderTest.MainWindow"
    Title="RadSlider TEST" Width="640" Height="320"
    Background="#FF393838" TextBlock.Foreground="White" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
            <RowDefinition Height="Auto" MinHeight="48"/>
            <RowDefinition Height="Auto" MinHeight="32"/>
        </Grid.RowDefinitions>
         
        <TextBlock Margin="8,8,8,2" Text="RadSlider(SelectionRangeEnable, Minimun:0.0, Maximum1.0) " VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <telerik:RadSlider x:Name="radSlider" Margin="8" VerticalAlignment="Center"
            SelectionStart="{Binding RangeBegin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
            SelectionEnd="{Binding RangeEnd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
            IsSelectionRangeEnabled="True" Grid.Row="1"/>
 
        <TextBlock Margin="8,8,8,2" Grid.Row="2" Text="MainWindow DependencyProperty Binding" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <Grid Margin="8" Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
 
            <TextBlock Margin="8" Text="RangeBegin" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            <TextBlock Margin="8" Grid.Row="1" TextWrapping="Wrap"
                Text="{Binding RangeBegin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
                VerticalAlignment="Center" Grid.Column="1" Foreground="Black" Background="White" />
            <TextBlock Margin="8" Text="RangeEnd" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right" />
            <TextBlock Margin="8" Grid.Row="1" TextWrapping="Wrap"
                Text="{Binding RangeEnd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                        RelativeSource={RelativeSource AncestorType={x:Type Window}} }"
                VerticalAlignment="Center" Grid.Column="3" Foreground="Black" Background="White" />
        </Grid>
 
        <TextBlock Margin="8,8,8,2" Grid.Row="4" Text="ControlBinding" VerticalAlignment="Bottom" FontSize="16" FontWeight="Bold"/>
        <Grid Margin="8" Grid.Row="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Margin="8" Text="SelectionStart" VerticalAlignment="Center" HorizontalAlignment="Right"/>
            <TextBlock Margin="8"
                Text="{Binding SelectionStart, ElementName=radSlider}"
                VerticalAlignment="Center" Grid.Column="1" Background="White" Foreground="Black" />
            <TextBlock Margin="8" Text="SelectionEnd" VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right"/>
            <TextBlock Margin="8"
                Text="{Binding SelectionEnd, ElementName=radSlider}"
                VerticalAlignment="Center" Grid.Column="3" Background="White" Foreground="Black" />
        </Grid>
    </Grid>
</Window>

[CS]
using System.Windows;
 
namespace RadSliderTest
{
    public partial class MainWindow : Window
    {
        #region [RangeBegin] DependencyProperty
        public double RangeBegin
        {
            get { return (double)GetValue(RangeBeginProperty); }
            set { SetValue(RangeBeginProperty, value); }
        }
        public static readonly DependencyProperty RangeBeginProperty =
            DependencyProperty.Register("RangeBegin", typeof(double), typeof(MainWindow), new PropertyMetadata(0.0));
        #endregion
 
        #region [RangeEnd] DependencyProperty
        public double RangeEnd
        {
            get { return (double)GetValue(RangeEndProperty); }
            set { SetValue(RangeEndProperty, value); }
        }
        public static readonly DependencyProperty RangeEndProperty =
            DependencyProperty.Register("RangeEnd", typeof(double), typeof(MainWindow), new PropertyMetadata(1.0));
        #endregion
 
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}
Takashi Nimura
Top achievements
Rank 1
 answered on 20 Sep 2011
3 answers
250 views
Hello,

I have problem with RadColumnSparkline with RadTimebar.
It seems like the bars don't placed in the correct location.

I've looked in the thread "Data is not display in correct time location" and there's an example there for RadLinearSparkline with RadTimebar, I tried that example and the result was correct, but when I had changed the control from RadLinearSparkline to RadColumnSparkline, I saw some shifting in the bars.

Do I need to do some extra modifications for using RadColumnSparkline?

(I tried with Telerik RadControls for WPF 2011 Q2 2011.2.0712 & 2011.2.0823)


Thanks
Missing User
 answered on 20 Sep 2011
3 answers
95 views
Hi,

I've got a nullpointer exception in AppointmentItem.EnsureSelection method. The occurrenceInfo is null.

void EnsureSelected()
{
    if (!this.IsSelected)
    {
        this.ScheduleView.UpdateSelectionOnMouseButton(this.occurrenceInfo.Occurrence, this.ActualRange, false, true, true, false);
    }
}

In the mouse handlers the occurrenceInfo is checked against being null:

private void AppointmentItemMouseRightButtonDown(object sender, MouseButtonEventArgs e)
    {
        if (this.ScheduleView != null && this.occurrenceInfo != null)
        {
            this.ScheduleView.UpdateSelectionOnMouseButton(this.occurrenceInfo.Occurrence, this.ActualRange, false, false);
            e.Handled = true;
        }
    }

    private void AppointmentItemMouseRightButtonUp(object sender, MouseButtonEventArgs e)
    {
        if (this.ScheduleView != null && this.occurrenceInfo != null)
        {
            this.ScheduleView.UpdateSelectionOnMouseButton(this.occurrenceInfo.Occurrence, this.ActualRange, false, true);
            e.Handled = false;
        }
    }

Could you fix this?
Thx,
Nico
Nico
Top achievements
Rank 1
 answered on 20 Sep 2011
1 answer
134 views
Hi,

I have just upgraded my Telerik from V2010.3.1314.35 to V2011.2.712.35 and I realized that the "DisplayDateChanged" event was remove and I found nothing about this change.

Can someone give me informations about this fix: Why this change was made, In which version this fix took place, etc...???

Thank's
Konstantina
Telerik team
 answered on 20 Sep 2011
1 answer
157 views
Hi,

I've attached an image which hopefully helps me to better describe my issue:
image

I need to enable drag and drop only for and within a single tree item.
So each content element within a tree item should only be drag-&dropable within the same item.
The tree items itself ( cars, trucks, etc.) shoudn't be draggable at all.

I'm having trouble to prevent a content drag&drop operation from one tree item to another one ( e.g (2) => (3)).

I would be glad for some help.

Thanks in advance

Thorsten

Kiril Stanoev
Telerik team
 answered on 20 Sep 2011
1 answer
516 views
 
I am trying to bind the background of the row to a variable in the datasource. I cannot seem to get it to work.
I am including the Xaml and Xaml.cs code to see if you can see what I am missing.

Reason for trying to bind to a variable is because I have a validate button in my program. It will return the ID of the invalid row
that will be highlighted in the treelistview... (the RowBGColor would be set to yellow ).


using System.Collections.ObjectModel;
using System.Windows;
using System.Drawing;
 
namespace TelerikRowBackground
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private int rowIndex = 1;
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Highlight Row: " + rowIndex);
             
            //TODO: Change row background for rowIndex to Yellow.
            // And reset previous hightlighted row.
 
 
            if(rowIndex == 3)
            {
                rowIndex = 1;
            }
            else
            {
                rowIndex++;
            }
        }
    }
 
    public class ViewModel
    {
        public ObservableCollection<Model> AllData
        {
            get
            {
                return new ObservableCollection<Model>()
                           {
                               new Model()
                                   {
                                       ID = 1,
                                       RowBGColor = Color.Red,
                                       Property1 = "Test1.1",
                                       Property2 = "Test2.1",
                                       Property3 = "Test3.1",
                                       Children = new ObservableCollection<Model>()
                                                      {
                                                          new Model()
                                                              {
                                                                  ID = 2,
                                                                  RowBGColor = Color.Yellow,
                                                                  Property1 = "Test1.2",
                                                                  Property2 = "Test2.2",
                                                                  Property3 = "Test3.2",
                                                                  Children = new ObservableCollection<Model>()
                                                                                 {
                                                                                     new Model()
                                                                                         {
                                                                                             ID = 3,
                                                                                             RowBGColor = Color.Green,
                                                                                             Property1 = "Test1.3",
                                                                                             Property2 = "Test2.3",
                                                                                             Property3 = "Test3.3"
                                                                                         }
                                                                                 }
                                                              }
                                                      }
                                   }
                           };
            }
        }
    }
 
    public class Model
    {
        public int ID { get; set; }
        public string Property1 { get; set; }
        public string Property2 { get; set; }
        public string Property3 { get; set; }
        public Color RowBGColor { get; set; }
        private ObservableCollection<Model> _children;
        public ObservableCollection<Model> Children
        {
            get { return _children ?? (_children = new ObservableCollection<Model>()); }
            set { _children = value; }
        }
    }
}



<Window x:Class=
"TelerikRowBackground.MainWindow"
        xmlns:local="clr-namespace:TelerikRowBackground" Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <local:ViewModel x:Key="MyViewModel"/>
    </Window.Resources>
 
    <DockPanel  DataContext="{StaticResource MyViewModel}">
        <telerik:RadTreeListView Name="radTreeListView1"
                                 DockPanel.Dock="Top"
                                 Margin="5,5,0,0"
                                 AutoGenerateColumns="False"                
                                 ItemsSource="{Binding AllData}"
                                 VerticalAlignment="Top"
                                 HorizontalAlignment="Left"
                                 IsFilteringAllowed="False"
                                 telerik:StyleManager.Theme="Windows7"
                                 EnableColumnVirtualization="True"
                                 EnableRowVirtualization="True"
                                 AutoExpandGroups="True" >
 
            <telerik:RadTreeListView.ItemContainerStyle>
                <Style TargetType="telerik:GridViewRowItem">
                    <Setter Property="Foreground" Value="{Binding RowBGColor}" />
                </Style>
            </telerik:RadTreeListView.ItemContainerStyle>
 
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
 
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn x:Name="idColumn" DataMemberBinding="{Binding ID, Mode=TwoWay }" Header="ID" />
                <telerik:GridViewDataColumn x:Name="prop1Column" DataMemberBinding="{Binding Property1, Mode=TwoWay }" Header="Property 1" />
                <telerik:GridViewDataColumn x:Name="prop2Column" DataMemberBinding="{Binding Property2, Mode=TwoWay }" Header="Property 2" />
                <telerik:GridViewDataColumn x:Name="prop3Column" DataMemberBinding="{Binding Property3, Mode=TwoWay }" Header="Property 3" />
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
        <Button DockPanel.Dock="Bottom" Height="50" Click="Button_Click" >Click to Highlight Row</Button>
    </DockPanel>
</Window>
Pavel Pavlov
Telerik team
 answered on 20 Sep 2011
3 answers
393 views
I have two instances where I drag appointment onto the ScheduleView. Once dragging from a listview to the scheduleview, and once when you drag within the scheduleview. In both cases I would like to complete some kind of action after the drop is completed. I have added the appropriate drop info handler but it never gets hit. I do have a custom drag behavior that handles the drop action itself. What do I have to do to make something happen after the drop is completed. OnDropInfo never fires...
//Drag and Drop handlers to the result listview and ScheduleView
            RadDragAndDropManager.AddDragQueryHandler(resultListView, OnDragQuery);
            RadDragAndDropManager.SetAllowDrop(taskBoardScheduleView, true);
            RadDragAndDropManager.AddDropInfoHandler(taskBoardScheduleView, OnDropInfo);
            taskBoardScheduleView.DragDropBehavior = new TaskBoardDragDropBehavior();


protected virtual void OnDropInfo(object sender, DragDropEventArgs e)
        {
            if (e.Options.Status == DragStatus.DropComplete)
            {
                RefreshScheduleView();
                //DateSpan dateSpan = new DateSpan(taskBoardScheduleView.VisibleRange.Start, taskBoardScheduleView.VisibleRange.End);
                //viewModel.GetTaskAppointments(dateSpan);
            }
        }
Valeri Hristov
Telerik team
 answered on 20 Sep 2011
1 answer
94 views
Buen dia, quiciera saber como invocar o llamar a un evento cuando se da click sobre el boton que cambia la vista del mes?

muchas gracias, si exitste dicho evento?
Yana
Telerik team
 answered on 20 Sep 2011
5 answers
219 views
Hey,

I need to customize how theCarousel animate its' items and how it's placing them.
The default behavior looks like this (Bold is the selected item, usually it looks different):

item1, item2, item3, item4, item5.

when you scroll left it looks like this:

item0, item1, item2, item3, item4, 

I need the carousel to behave like this:

item1, item2, item3, item4, item5.

when you scroll left it looks like this:

item1, item2, item3, item4

I hope it is clearn enough.

Ariel
Maya
Telerik team
 answered on 20 Sep 2011
1 answer
78 views
Is function IndexOf in DataItemCollecion using Equals method on objects?
Nedyalko Nikolov
Telerik team
 answered on 20 Sep 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?