Telerik Forums
UI for WPF Forum
1 answer
99 views
I'm setting the PeriodEnd on the Timebar control without any time component, i.e. 3/7/2011 12:00:00 AM.  When selecting dates on the UI, I can only select until 3/6/2011?  Is there a way to change this to display/select the PeriodEnd being passed in? I'm by default selecting the full date range (PeriodStart - PeriodEnd). 
Yavor
Telerik team
 answered on 30 May 2012
1 answer
85 views
Hello. I'm trying to change the standard behaviour of LeftClick (zoom) to RightClick, and also stop the event from firing on left click so I can set up my own behaviour. Is this possible?

Regards,
Dan
Giuseppe
Telerik team
 answered on 30 May 2012
2 answers
130 views
Hello,

I've got a problem with a gridview.

The first cell is set to IsReadOnly=true, so the cursor starts at the 2nd cell, but when I press tab the focus is on the "frame" of cell 3, not inside it, and i'm unable to tab to the next cell or type anything in the cell. I have to click with the mouse inside the cell, and then everything works fine.

I've attached 2 screen shots.

Any ideas/solutions to this problem?

Cheers
Kasper
Top achievements
Rank 2
 answered on 30 May 2012
2 answers
73 views
We are hosting the RadTreeView in our application inside of a winforms window and the drag/drop functionality (exact same code) that works in a WPF does not work when hosted in a winforms window.  Is there a reason for this behavior?

Thanks!
Hristo
Telerik team
 answered on 30 May 2012
1 answer
153 views
is it possible to use a gantt view and time bar together?
when I tried, it came back with some weird results, but perhaps I am doing it wrong, or it just wont work.
see screen shot.  notice that it thinks the columns are part of the time range.
Miroslav Nedyalkov
Telerik team
 answered on 30 May 2012
2 answers
337 views
Hi,

i'm using the example "RadListBox Drag and Drop":
<Grid>
  <Grid.RowDefinitions>
    <RowDefinition Height="Auto" />
    <RowDefinition Height="*" />
  </Grid.RowDefinitions>
  <Border Grid.Row="0" Height="22" BorderBrush="#FFD6D4D4" BorderThickness="0,0,0,1"
          VerticalAlignment="Top" Background="#FFF7F7F7" HorizontalAlignment="Stretch">
    <TextBlock Style="{StaticResource HeaderTextBlockStyle}" Text="Final tournament" Margin="6 2 2 2"  />
  </Border>
  <telerik:RadListBox Grid.Row="1" AllowDrop="True" ItemsSource="{Binding GroupD}"
                     ItemTemplate="{StaticResource ListBoxItemTemplate}">
  <telerik:RadListBox.DragVisualProvider>
    <telerik:ScreenshotDragVisualProvider />
    </telerik:RadListBox.DragVisualProvider>
    <telerik:RadListBox.DragDropBehavior>
    <telerik:ListBoxDragDropBehavior AllowReorder="True" />
  </telerik:RadListBox.DragDropBehavior>
</telerik:RadListBox>
                </Grid>

Now i want to add a "popup-control" to the ListboxItems.

<Popup x:Name="popUpnotifyIcon" AllowsTransparency="True" PopupAnimation="Fade" Placement="Top"  PlacementTarget="{Binding ElementName=yahoo}" HorizontalOffset="0" VerticalOffset="20" >
    <Viewbox VerticalAlignment="Top" >
        <TextBlock Text="dfsdfsdf" />
    </Viewbox>
</Popup>

But how do i open the popup when i click a Listboxitem or onmouseover on listboxitem?

Thanks
Rene

ITA
Top achievements
Rank 1
 answered on 30 May 2012
0 answers
73 views
I can sort columns programmatic like the example in documentation using ColumnSortDescriptors
http://www.telerik.com/help/wpf/gridview-sorting-programmatic.html
Also I have a Custom Sorting defined using the GridView Sorting event:
this.radGridView.Sorting += this.radGridView_Sorting; 
http://www.telerik.com/help/wpf/gridview-sorting-custom.html
This event only is fired when the user click in the column header it's not fired automatic. How can Sort automatic?

Thank you.
Jordi
Top achievements
Rank 1
 asked on 30 May 2012
1 answer
184 views
Hi guys,

Maybe I am just doing something wrong, but I have lost a lot of time on this already and have no idea what is going on.

I basically have a RadScheduleView Control inside of a Grid on a UserControl. This control is then placed inside of a Grid on a Window. Pretty simple and working perfectly.

My UserControl:
 
<UserControl x:Class="MonitoringRounds"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:EScIS.Win.Controls.MonitoringRounds"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignHeight="600" d:DesignWidth="1000" >
    <UserControl.DataContext>
        <local:MonitoringRoundsViewModel/>
    </UserControl.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.05*" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0">Monitoring Rounds</TextBlock>
        <telerik:RadScheduleView Grid.Row="1" Name="radsvMonitoringRounds" Padding="5" MaxHeight="400" MaxWidth="600" AppointmentsSource="{Binding Appointments}" ResourceTypesSource="{Binding ResourcesTypes}">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:MonthViewDefinition />
                <telerik:TimelineViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
</UserControl>

My Window:

<Window x:Class="LSpecs"
    xmlns:menu="clr-namespace:EScIS.Win.LSpecs.UI.Controls.Menu;assembly=EScIS.Win.LSpecs.UI.Controls.Menu"
    xmlns:ma ="clr-namespace:EScIS.Win.Controls.MonitoringAssignees;assembly=EScIS.Win.Controls.MonitoringAssignees"
    xmlns:mp ="clr-namespace:EScIS.Win.Controls.MonitoringPrograms;assembly=EScIS.Win.Controls.MonitoringPrograms"
    xmlns:mr ="clr-namespace:EScIS.Win.Controls.MonitoringRounds;assembly=EScIS.Win.Controls.MonitoringRounds"
    Title="Desktop" Height="1200" Width="1900" WindowState="Maximized">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition />
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Name="borderMainToolBar" BorderThickness="0,0,0,2" BorderBrush="Gray">
            <menu:MainToolbar Name="ctrlMainToolBar" menu:MainToolbar.Button_Click_WorkflowMenu="ctrlDesktop_Button_Click_WorkflowMenu"/>
        </Border>
        <menu:Desktop Grid.Row="1" Name="ctrlDesktop" 
                      menu:WorkflowFieldPreparation.Button_Click_MonitoringAssignees="Desktop_Button_Click_MonitoringAssignees"
                      menu:WorkflowFieldPreparation.Button_Click_MonitoringPrograms="ctrlDesktop_Button_Click_MonitoringPrograms"
                      menu:WorkflowFieldPreparation.Button_Click_MonitoringRounds="ctrlDesktop_Button_Click_MonitoringRounds"
                      />
        <ma:MonitoringAssignees  Grid.Row="1" Name="ctrlMonitoringAssignees" Visibility="Hidden"/>
        <mp:MonitoringPrograms  Grid.Row="1" Name="ctrlMonitoringPrograms" Visibility="Hidden"/>
        <mr:MonitoringRounds  Grid.Row="1" Name="ctrlMonitoringRounds" Visibility="Hidden"/>
    </Grid>
</Window>


On the code side of the story I am using a simplified MVVM pattern with a ViewModel supporting my control:

Imports EScIS.Database
Imports EScIS.MVVM.Base
Imports System.ComponentModel
Imports System.Collections.ObjectModel
Imports System.Windows.Data
Imports Telerik.Windows.Controls
Imports Telerik.Windows.Controls.ScheduleView
 
Public Class MonitoringRoundsViewModel
    Inherits EScIS.MVVM.Base.ViewModelBase
 
    Private _context As ESdatEntities
    Private _monitoringRounds As ObservableCollection(Of Monitoring_Rounds)
    Private _monitoringRoundsView As ICollectionView
    Private _monitoringPrograms As ObservableCollection(Of LSPECS_Monitoring_Programs)
    Private _monitoringProgramsView As ICollectionView
    Private _monitoringRoundsAssignedMonitoringPrograms As ObservableCollection(Of LSPECS_Monitoring_Round_Assigned_Monitoring_Programs)
    Private _monitoringRoundsAssignedMonitoringProgramsView As ICollectionView
 
    Private _appointments As ObservableCollection(Of Appointment)
    Private _resourcesTypes As ObservableCollection(Of ResourceType)
 
    Public Property MonitoringRoundsList() As ObservableCollection(Of Monitoring_Rounds)
        Get
            Return Me._monitoringRounds
        End Get
        Set(value As ObservableCollection(Of Monitoring_Rounds))
            Me._monitoringRounds = value
            Me.OnPropertyChanged("MonitoringRoundsList")
        End Set
    End Property
 
    Public Property MonitoringProgramsList() As ObservableCollection(Of LSPECS_Monitoring_Programs)
        Get
            Return Me._monitoringPrograms
        End Get
        Set(value As ObservableCollection(Of LSPECS_Monitoring_Programs))
            Me._monitoringPrograms = value
            Me.OnPropertyChanged("MonitoringProgramsList")
        End Set
    End Property
 
    Public Property MonitoringRoundsAssignedMonitoringProgramsList() As ObservableCollection(Of LSPECS_Monitoring_Round_Assigned_Monitoring_Programs)
        Get
            Return Me._monitoringRoundsAssignedMonitoringPrograms
        End Get
        Set(value As ObservableCollection(Of LSPECS_Monitoring_Round_Assigned_Monitoring_Programs))
            Me._monitoringRoundsAssignedMonitoringPrograms = value
            Me.OnPropertyChanged("MonitoringRoundsAssignedMonitoringProgramsList")
        End Set
    End Property
 
    Public Property Appointments() As ObservableCollection(Of Appointment)
        Get
            Return Me._appointments
        End Get
        Set(value As ObservableCollection(Of Appointment))
            Me._appointments = value
            Me.OnPropertyChanged("Appointments")
        End Set
    End Property
 
    Public Property ResourcesTypes() As ObservableCollection(Of ResourceType)
        Get
            Return Me._resourcesTypes
        End Get
        Set(value As ObservableCollection(Of ResourceType))
            Me._resourcesTypes = value
            Me.OnPropertyChanged("ResourcesTypes")
        End Set
    End Property
 
    Public Sub New()
        Me.Load(Nothing)
    End Sub
 
    Protected Overrides Sub Add(action As Object)
 
    End Sub
 
    Protected Overrides Sub Delete(action As Object)
 
    End Sub
 
    Protected Overrides Sub Edit(action As Object)
 
    End Sub
 
    Protected Overrides Sub Load(action As Object)
        LoadData()
        LoadCalendarData()
    End Sub
 
    Public Sub LoadControlData()
        Me.Load(Nothing)
    End Sub
 
    Private Sub LoadData()
        Try
            With Me._context
 
                Me._context = New ESdatEntities()
 
                Me.MonitoringRoundsList = New ObservableCollection(Of Monitoring_Rounds)(
                                        From mr In Me._context.Monitoring_Rounds
                                        Select mr)
                Me.MonitoringProgramsList = New ObservableCollection(Of LSPECS_Monitoring_Programs)(
                                        From mp In Me._context.LSPECS_Monitoring_Programs
                                        Select mp)
                Me.MonitoringRoundsAssignedMonitoringProgramsList = New ObservableCollection(Of LSPECS_Monitoring_Round_Assigned_Monitoring_Programs)(
                                        From mramp In Me._context.LSPECS_Monitoring_Round_Assigned_Monitoring_Programs
                                        Select mramp)
 
            End With
        Catch ex As Exception
            Debug.WriteLine(ex.Message)
            Throw New ApplicationException("Database Error: " & ex.Message)
        End Try
 
        Me._monitoringRoundsView = CollectionViewSource.GetDefaultView(Me.MonitoringRoundsList)
        Me._monitoringProgramsView = CollectionViewSource.GetDefaultView(Me.MonitoringProgramsList)
        Me._monitoringRoundsAssignedMonitoringProgramsView = CollectionViewSource.GetDefaultView(Me.MonitoringRoundsAssignedMonitoringProgramsList)
 
        Me.OnPropertyChanged("MonitoringRoundsList")
        Me.OnPropertyChanged("MonitoringProgramsList")
        Me.OnPropertyChanged("MonitoringRoundsAssignedMonitoringProgramsList")
    End Sub
 
    Private Sub LoadCalendarData()
        'GenerateResourcesFromMonitoringPrograms()
        'GenerateAppointmentsFromMonitoringPrograms()
        'GenerateAppointmentsFromMonitoringRounds()
        Me.ResourcesTypes = New ObservableCollection(Of ResourceType)
        Me.Appointments = New ObservableCollection(Of Appointment)
    End Sub
 
    Private Sub GenerateResourcesFromMonitoringPrograms()
        Me.ResourcesTypes = New ObservableCollection(Of ResourceType)
 
        'Add monitoring program resource type
        Dim mpType As New ResourceType("Monitoring Program")
 
        'Add monitoring programs as resources
        If Me._monitoringPrograms Is Nothing Then
            Return
        End If
 
        For Each mp In _monitoringPrograms
            Dim res As New Resource(mp.Monitoring_Program)
            mpType.Resources.Add(res)
        Next
 
        Me.ResourcesTypes.Add(mpType)
        Me.OnPropertyChanged("ResourcesTypes")
    End Sub
 
    Private Sub GenerateAppointmentsFromMonitoringPrograms()
        Me.Appointments = New ObservableCollection(Of Appointment)
 
        'Add monitoring programs as appointments
        If Me._monitoringPrograms Is Nothing Then
            Return
        End If
 
        For Each mp In _monitoringPrograms
            Dim app As New Appointment()
            app.Subject = mp.Monitoring_Program
            app.Start = mp.Start_Date
            app.End = If(mp.End_Date.HasValue, mp.End_Date, mp.Start_Date)
 
            Me.Appointments.Add(app)
        Next
 
        Me.OnPropertyChanged("Appointments")
    End Sub
 
    Private Sub GenerateAppointmentsFromMonitoringRounds()
        If Me.Appointments Is Nothing Then
            Me.Appointments = New ObservableCollection(Of Appointment)
        End If
 
        'Add MonitoringRounds as appointments
        If Me._monitoringRounds Is Nothing Then
            Return
        End If
 
        For Each mr In _monitoringRounds
            Dim app As New Appointment()
            app.Subject = mr.Monitoring_Round
            app.Start = mr.Start_Date
            app.End = If(mr.End_Date.HasValue, mr.End_Date, mr.Start_Date)
 
            Me.Appointments.Add(app)
        Next
 
        Me.OnPropertyChanged("Appointments")
    End Sub
 
    Public Overrides Sub Dispose()
        If Not Me.disposed Then
            Me._context.Dispose()
            Me.disposed = True
        End If
        MyBase.Dispose()
    End Sub
 
End Class

On the ViewModel behind the window I basically set the visibility of the control to visible when a user clicks on a button. All this works fine.

Also at the moment I am not even trying to add any Appointments. I commented that bit of the code out to eliminate sources of problems. All I want is the control to display properly with the default view and no appointments.

When the control is rendered in run time all the header/menu structure renders fine, but the content area is blank. See attached photo for image of this.

At design time it appears to be fine since it displays the usual "Please set an Appointments Source" message.

Any idea what might be causing this?

Using:
Visual Studio 2010
Targeting .NET Framework 4.0
Windows 7
Telerik.Windows.Controls.ScheduleView vs. 2012.1.326.40

Thanks for your help in advance.

Guga
Top achievements
Rank 1
 answered on 30 May 2012
8 answers
445 views
Hi 

I am trying to implement a RadContextMenu and am not seeming to be able to get the DisplayMemberPath to work

The following code does not display the correct label on the menuitem ( the menu items do display)

<telerik:RadButton cal:Message.Attach="Show" BorderBrush="{x:Null}" Background="{x:Null}"
                        Foreground="Black" FontFamily="Arial" Margin="1,3">
                     <Grid>
                         <telerik:RadContextMenu.ContextMenu>
                             <telerik:RadContextMenu  ItemsSource="{Binding Items}"
Placement="Right" DisplayMemberPath="DisplayName"   / >
                         
                         </telerik:RadContextMenu.ContextMenu>
                         
                         <TextBlock VerticalAlignment="Top"
                                     Foreground="Red"
                                     HorizontalAlignment="Right"
                                     Margin="2"
                                     Text="{Binding Status}" />
 
         <StackPanel>
 
                            
                             <Image Source="{Binding Icon}" HorizontalAlignment="Center" VerticalAlignment="Center" />
           <TextBlock Text="{Binding IconName}" Foreground="White" HorizontalAlignment="Center" />
 
         </StackPanel>
                     
                     </Grid>
  
     </telerik:RadButton>

But this code does

<telerik:RadContextMenu.ContextMenu>
                                    <telerik:RadContextMenu  ItemsSource="{Binding Items}" Placement="Right" DisplayMemberPath="DisplayName"    >
                                        <telerik:RadContextMenu.ItemTemplate>
                                            <DataTemplate>
                                              
                                                <TextBlock Text="{Binding DisplayName}"  />                                
                                            </DataTemplate>                            
                                        </telerik:RadContextMenu.ItemTemplate>
                                                                             
                                    </telerik:RadContextMenu>
                                </telerik:RadContextMenu.ContextMenu>


I don't want to use the second code I would like to use DisplayMemberPath.  I also tried setting ToString() on the buisness object as stated in the documenation (http://www.telerik.com/help/wpf/radcontextmenu-populating-with-data-data-binding-support-overview.html ) But this did not work either.

Does anyone have any idea why this isn't working?

thanks

Murray


Murray
Top achievements
Rank 1
 answered on 30 May 2012
2 answers
178 views
I would like my application GUI to be able to scale with the amount of screen estate available. Using a TileView, seems like the only options to control the column width are:
  1. set ColumnsCount of the TileView, which will cause the tile to resize as the view resizes
  2. set ColumnWidth, which gives each column a fixed width regardless of the size of the view, number of column would change according to the view width.

I quite like the second method, except that it leaves a rather ugly empty void on one side of the TileView.

Is there an option to either:
  • Cause the tile to stretch similar to when ColumnsCount is set? maybe with a MinimumColumnWidth property... For example, if MinimumColumnWidth=300 and the TileView width is 1100, each of the 3 columns will have the width of 366, and when the TileView has a width of 1200, one more column will appear with width of 300 each.
  • Evenly space the columns across the whole width of the TileView?

Wenrong
Top achievements
Rank 1
 answered on 30 May 2012
Narrow your results
Selected tags
Tags
+113 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?