Telerik Forums
UI for WPF Forum
1 answer
132 views

Is there the capability to generate and display slots when an appointment is started to be dragged?

I.e.  I have an appointment and I want to restrict that it can only be moved within a 2 day window either direction.  I can do the CanDrop/Drop in a CustomDragDropBehavior to do the actual restriction, however I'd like to visually show the user that they cannot move it 3 days.

Nasko
Telerik team
 answered on 31 Jul 2015
4 answers
563 views
I'm getting "Handler type not valid" when I set the Selected event in the RowStyle.
My XAML is:
<telerik:RadGridView.RowStyle>
  <Style TargetType="telerik:GridViewRow" >
     <EventSetter Event="Selected" Handler="pHandleItemSelected" />
  </Style>
</telerik:RadGridView.RowStyle>
And my event handler is:
Private Sub pHandleItemSelected(sender As System.Object, e As RoutedEventArgs)
End 

The documentation says that this is the type of handler. So what is the problem?





Dimitrina
Telerik team
 answered on 31 Jul 2015
4 answers
299 views

Hello,

I want to align some custom shapes vertically from my diagram.  I make a method called AlignShapes inside a class inheried from SerializableGraphSourceBase<Shape_VM, Link_VM>, and this method is invoked always when InternalItems Changed.

I have create my custom shape class, inherited from NodeViewModelBase and I give it 2 properties, Height and Width (double), that I binded these properties in XAML. Depend of the custom shape, height value is NaN for auto-size, then, when I get the value from custom shape, it return NaN, but the shape in the diagram has a specific height value that I do not know to get.

 How can I get Shape ActualHeight?

 

Thank you!

 

Mikel
Top achievements
Rank 1
 answered on 31 Jul 2015
1 answer
325 views

Hello,

in the download page, the offline CHM documentation is marked as Telerik_UI_for_WPF_ApiReference_2015_2_728.chm.

When the file is downloaded and opened, it says that the documentation is for the previous version: Assembly: Telerik.Windows.Controls.Input (in Telerik.Windows.Controls.Input.dll) Version: 2015.2.623.40 (2015.2.623.40)

Naturally, the new members are missing from the documentation...​

Dimitrina
Telerik team
 answered on 30 Jul 2015
2 answers
113 views

Hi,

How can I prevent selected items on treelistview child nodes?

 

Thank you

Mattia
Top achievements
Rank 2
 answered on 30 Jul 2015
1 answer
104 views
I'm using a GridView wich RowDetailsTemplate is another GridView, i need to iterate inner GridView rows... i'm iterating parent GridView rows this way

IList<GridViewRow> rows = radGridView.ChildrenOfType<GridViewRow>();

but how can i get the GridView inside the row details template 
Stefan
Telerik team
 answered on 30 Jul 2015
1 answer
548 views

Hi, 

How to get the number of pages of the PdfViewer document?
I am pasting (in case) a part of the code where I am importing the pdf document.

 

public void ShowPdfFile(RadPdfViewer rad, string documentPath)
{
    _radPdfViewer = rad;
    _documentPath = documentPath;
 
    try
    {
        var readAllBytes = File.ReadAllBytes(documentPath);
        var memoryStream = new MemoryStream(readAllBytes);
        rad.DocumentSource = new PdfDocumentSource(memoryStream);
    }
    catch (Exception e)
    {
    }
}

Is it possible to get also the number of pages of the RadRichTextBox document?​

BR,

Marta

Tanya
Telerik team
 answered on 30 Jul 2015
13 answers
1.3K+ views
Do you guys have a sample solution that does the filter on the Tree Generically. I have searched and all the examples are hard coded to filter couple of levels but they don't work if the tree has multiple levels.

Could you please help me with a solution for this? I have tried using CollectionViewSource, but not able to filter below the Root level I am able to filter only at the top level. 

Lets for example I have this Tree - got this from one of your examples. 

Animal
  Dog
  Cat
Fish
   Fresh Water
       Roach
       Bream
    Salt Water
        Skate
              SkateChild
        Soul


In this example, If I type  "d" , I should get the following result.
Animal
    Dog
Fish
    Salt Water 
         Skate
              SkateChild

Please let me know if you can help me with a solution that would work for n level of nodes. 

This is highly critical for us and any help on this is really appreciated. 



   



Petar Mladenov
Telerik team
 answered on 30 Jul 2015
1 answer
224 views

Hey,

I am trying to get my appointments to update in a backgroundworker. I have the backgroundworker up and running but when I assign my appointments to the ObservableCollection on the viewmodel  in the RunWorkerCompleted and fire the NofityPropertyChanged I get an error "Must create DependencySource on same Thread as the DependencyObject." I do not get this error when notifying of changes to strings and ints. Do you know of any reasons why the NotifyPropertyChanged would not work. 

 Thanks

Kalin
Telerik team
 answered on 30 Jul 2015
1 answer
401 views

Hi there.

 I ran into a problem when changing the template for TreeView control. I modified the ItemContainerStyle as follows:

        <Style x:Key="FileBrowserItemStyle" TargetType="{x:Type telerik:RadTreeViewItem}">
            <Setter Property="FocusVisualStyle">
                <Setter.Value>
                    <Style>
                        <Setter Property="Control.Template">
                            <Setter.Value>
                                <ControlTemplate>
                                    <Rectangle Margin="0" Stroke="Transparent" StrokeThickness="0"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Padding" Value="1,4,5,4"/>
            <Setter Property="MinHeight" Value="24"/>
            <Setter Property="IsDropAllowed" Value="True"/>
            <Setter Property="IsEnabled" Value="True"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:RadTreeViewItem}">
                        <Grid x:Name="RootElement" UseLayoutRounding="True">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="EditStates">
                                    <VisualState x:Name="Display"/>
                                    <VisualState x:Name="Edit">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EditHeaderElement">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Header">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Header"/>
                                            <DoubleAnimation Duration="0" To="0.35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Image"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Unselected"/>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="SelectionVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="SelectedUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="SelectionUnfocusedVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="LoadingOnDemandStates">
                                    <VisualState x:Name="LoadingOnDemand">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LoadingVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Expander">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0:0:1" From="0" RepeatBehavior="Forever" To="359" Storyboard.TargetProperty="Angle" Storyboard.TargetName="LoadingVisualAngleTransform"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="LoadingOnDemandReverse"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ExpandStates">
                                    <VisualState x:Name="Expanded">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ItemsHost">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Collapsed"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="HeaderRow" Background="Transparent" MinHeight="{TemplateBinding MinHeight}" SnapsToDevicePixels="True">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="6" Grid.Column="2" CornerRadius="2"/>
                                <Border x:Name="MouseOverVisual" BorderBrush="#FF838383" BorderThickness="1" Grid.ColumnSpan="6" Grid.Column="2" CornerRadius="1" Opacity="0">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFDADADA" Offset="1"/>
                                            <GradientStop Color="#FFB6B6B6" Offset="0"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Border BorderBrush="White" BorderThickness="1" Background="{x:Null}" CornerRadius="0"/>
                                </Border>
                                <Border x:Name="SelectionUnfocusedVisual" BorderBrush="#FFDBDBDB" BorderThickness="1" Grid.ColumnSpan="6" Grid.Column="2" CornerRadius="1" Visibility="Collapsed">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0,1">
                                            <GradientStop Color="#FFF8F6F9" Offset="0"/>
                                            <GradientStop Color="#FFCBCBCB" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Border BorderBrush="Transparent" BorderThickness="1" Background="{x:Null}" CornerRadius="0"/>
                                </Border>
                                <Border x:Name="SelectionVisual" BorderBrush="#FF494949" BorderThickness="1" Grid.ColumnSpan="6" Grid.Column="2" CornerRadius="1" Visibility="Collapsed">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFBBBBBB" Offset="1"/>
                                            <GradientStop Color="#FF959595"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Border BorderBrush="White" BorderThickness="1" Background="{x:Null}" CornerRadius="0"/>
                                </Border>
                                <StackPanel x:Name="IndentContainer" Orientation="Horizontal">
                                    <Rectangle x:Name="IndentFirstVerticalLine" Stroke="#FFCCCCCC" Visibility="Collapsed" VerticalAlignment="Top" Width="1"/>
                                </StackPanel>
                                <Grid x:Name="ListRootContainer" Grid.Column="1" HorizontalAlignment="Center" MinWidth="21">
                                    <Rectangle x:Name="HorizontalLine" HorizontalAlignment="Right" Height="1" Stroke="#FFCCCCCC" VerticalAlignment="Center"/>
                                    <Rectangle x:Name="VerticalLine" HorizontalAlignment="Center" Stroke="#FFCCCCCC" VerticalAlignment="Top" Width="1"/>
                                    <ToggleButton x:Name="Expander" Background="{TemplateBinding Background}" IsTabStop="False"/>
                                    <Grid x:Name="LoadingVisual" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" VerticalAlignment="Center">
                                        <Grid.RenderTransform>
                                            <TransformGroup>
                                                <RotateTransform Angle="0" CenterY="0.5" CenterX="0.5"/>
                                            </TransformGroup>
                                        </Grid.RenderTransform>
                                        <Path Data="M1,0A1,1,90,1,1,0,-1" Height="10" StrokeStartLineCap="Round" Stretch="Fill" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Width="10"/>
                                        <Path Data="M0,-1.1L0.1,-1 0,-0.9" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="4" Margin="5,-1.5,0,0" Stretch="Fill" StrokeThickness="1" VerticalAlignment="Top" Width="4"/>
                                    </Grid>
                                </Grid>
                                <Image x:Name="Image" Grid.Column="3" HorizontalAlignment="Center" MaxWidth="20" MaxHeight="20" Margin="2" VerticalAlignment="Center"/>
                                <Rectangle x:Name="FocusVisual" Grid.ColumnSpan="6" Grid.Column="2" IsHitTestVisible="False" RadiusY="3" RadiusX="3" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2" Visibility="Collapsed"/>
                                <Grid x:Name="HeaderContentPanel" Background="Transparent" Grid.ColumnSpan="2" Grid.Column="4">
                                    <ContentControl x:Name="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{Binding Foreground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    <ContentPresenter x:Name="EditHeaderElement" ContentTemplate="{TemplateBinding HeaderEditTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Grid>
                                <CheckBox x:Name="CheckBoxElement" Grid.Column="2" IsTabStop="False" Margin="5,0,0,0" Visibility="Collapsed" VerticalAlignment="Center">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </CheckBox>
                                <RadioButton x:Name="RadioButtonElement" Grid.Column="2" IsTabStop="False" Margin="5,0,0,0" Visibility="Collapsed" VerticalAlignment="Center">
                                    <telerik:StyleManager.Theme>
                                        <telerik:Office_BlackTheme/>
                                    </telerik:StyleManager.Theme>
                                </RadioButton>
                            </Grid>
                            <ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <telerik:TreeViewPanel IsItemsHost="True" IsVisualCacheEnabled="False" VerticalAlignment="Bottom"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>

 

and assigned the template to the control:

        <telerik:RadTreeView x:Name="FileList" FontSize="18" FontFamily="Courier New" HorizontalAlignment="Left" Height="250" VerticalAlignment="Top" Width="150" Background="#FFEEEEEE" Style="{DynamicResource FileBrowserStyl}" ItemContainerStyle="{DynamicResource FileBrowserItemStyle}"/>

All I really did was changing the color of the selected item from orange to grey  but it only seems to change the color for the first level of hierarchy (image attached). I thought the ItemContainerStyle applies for all levels. Am I missing something?

 Would really appreciate your help.

Thank you

Sia
Telerik team
 answered on 30 Jul 2015
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?