Telerik Forums
UI for WPF Forum
1 answer
70 views
I have a very simple model.
Users can choose multiple surfaces to show the scheduled events. Basically I have to group them ( in all views) by each surface name.
Something very similar to your first look example. But we get all that data from a database. So the surface selection is always dynamic.
And each surface has it's own color elements. Also, each appointment belongs to a particular customer and users can assign different color properties to each of these clients. I want to know, if you guys can give me a full ( event if it is simple) example of how I can achieve this using XML as my data source? I am kind of new to your controls.
Rosi
Telerik team
 answered on 25 Oct 2011
1 answer
211 views

Hello,
Can I stop the grid from being rendered while manipulating data, and making it render again only at a specific point?

Now I have serious performance issues, which seems to be caused by over re-measuring of the grid.

Pavel Pavlov
Telerik team
 answered on 25 Oct 2011
8 answers
540 views
Hi,

I need to show the close button in the header rather than at the right most position of the pane(default view)! Is there any property or style settings to achieve this? Or should I extend the control!

Thanks,
Godwin
Godwin
Top achievements
Rank 1
 answered on 25 Oct 2011
1 answer
159 views

Hi,

in my application, I'm using Telerik theme "Office_BlueTheme" and the control HeaderedContentControl doesn't seem to be affected by the theme I choose, I mean, the header of the control stay gray instead of having a kind of blue like other Telerik controls I used.

Thank's

Boyan
Telerik team
 answered on 25 Oct 2011
1 answer
130 views
Right, I have a list box to the left, and a schedule view to the right. On the schedule view I have included resources, by which I group. When I drag from the list to the schedule view, I can only drop onto the first group. When I attempt to drag an appointment already on the schedule view to another group on the schedule view, it won't allow it.

I have implemented a custom drag drop behaviour class:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.DragDrop;
using Telerik.Windows.Controls.ScheduleView;
 
namespace WpfApplication3
{
	public class ListBoxDragDropBehavior : Freezable
	{
		public static readonly DependencyProperty AppointmentTemplateProperty =
			DependencyProperty.Register("AppointmentTemplate"typeof(DataTemplate), typeof(ListBoxDragDropBehavior), null);
 
		public static readonly DependencyProperty EffectivePixelLengthProperty =
			DependencyProperty.Register("EffectivePixelLength"typeof(TimeSpan), typeof(ListBoxDragDropBehavior), null);
 
		public static readonly DependencyProperty EffectiveOrientationProperty =
			DependencyProperty.Register("EffectiveOrientation"typeof(Orientation), typeof(ListBoxDragDropBehavior), null);
 
		public static readonly DependencyProperty BehaviorProperty =
			DependencyProperty.RegisterAttached("Behavior"typeof(ListBoxDragDropBehavior), typeof(ListBoxDragDropBehavior), new PropertyMetadata(new PropertyChangedCallback(OnBehaviorChanged)));
 
		public DataTemplate AppointmentTemplate
		{
			get { return (DataTemplate)GetValue(AppointmentTemplateProperty); }
			set { SetValue(AppointmentTemplateProperty, value); }
		}
 
		public TimeSpan EffectivePixelLength
		{
			get { return (TimeSpan)GetValue(EffectivePixelLengthProperty); }
			set { SetValue(EffectivePixelLengthProperty, value); }
		}
 
		public Orientation EffectiveOrientation
		{
			get { return (Orientation)GetValue(EffectiveOrientationProperty); }
			set { SetValue(EffectiveOrientationProperty, value); }
		}
        
		public static ListBoxDragDropBehavior GetBehavior(DependencyObject obj)
		{
			return (ListBoxDragDropBehavior)obj.GetValue(BehaviorProperty);
		}
 
		public static void SetBehavior(DependencyObject obj, ListBoxDragDropBehavior value)
		{
			obj.SetValue(BehaviorProperty, value);
		}
 
		protected override Freezable CreateInstanceCore()
		{
			return new ListBoxDragDropBehavior();
		}
 
		private static void OnBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			System.Windows.Controls.ListBox listBox = d as System.Windows.Controls.ListBox;
			if (listBox == null)
			{
				return;
			}
 
			ListBoxDragDropBehavior behavior = (ListBoxDragDropBehavior)e.OldValue;
			if (behavior != null)
			{
				RadDragAndDropManager.RemoveDragQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDragQuery));
				RadDragAndDropManager.RemoveDropQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDropQuery));
				RadDragAndDropManager.RemoveDropInfoHandler(listBox, new EventHandler<DragDropEventArgs>(behavior.OnDropInfo));
			}
 
			behavior = (ListBoxDragDropBehavior)e.NewValue;
			if (behavior != null)
			{
				RadDragAndDropManager.SetAllowDrop(listBox, true);
				RadDragAndDropManager.AddDragQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDragQuery));
				RadDragAndDropManager.AddDropQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDropQuery));
				RadDragAndDropManager.AddDropInfoHandler(listBox, new EventHandler<DragDropEventArgs>(behavior.OnDropInfo));
			}
		}
 
		private void OnDragQuery(object sender, DragDropQueryEventArgs e)
		{
			if (e.Options.Status == DragStatus.DragQuery)
			{
				System.Windows.Controls.ListBox listbox = sender as System.Windows.Controls.ListBox;
 
				IList<IOccurrence> appointments = listbox.SelectedItems.OfType<IOccurrence>().ToList();
 
				if (appointments.Count == 0)
				{
					return;
				}
 
				e.Options.DragCue = this.CreateDragCue(appointments);
				e.Options.Payload = new ScheduleViewDragDropPayload(listbox.ItemsSource, appointments);
			}
 
			e.QueryResult = true;
		}
 
		private void OnDropQuery(object sender, DragDropQueryEventArgs e)
		{
			e.QueryResult = e.Options.Payload is ScheduleViewDragDropPayload;
		}
 
		private void OnDropInfo(object sender, DragDropEventArgs e)
		{
            System.Windows.Controls.ListBox listBox = sender as System.Windows.Controls.ListBox;
 
			if (e.Options.Status == DragStatus.DropPossible)
			{
				RadDragAndDropManager.Options.Effects = DragDropEffects.All;
				RadDragAndDropManager.Options.CurrentCursor = System.Windows.Input.Cursors.Arrow;
			}
 
            //If the user has dropped - and the drag was made FROM the scheduleview TO the listbox
			if (e.Options.Status == DragStatus.DropComplete && !listBox.IsAncestorOf(e.Options.Source))
			{
				ScheduleViewDragDropPayload payload = e.Options.Payload as ScheduleViewDragDropPayload;
				if (payload != null)
				{
					(payload.SourceAppointmentsSource as IList).RemoveAll((object i) => payload.DraggedAppointments.OfType<object>().Contains(i));
					(listBox.ItemsSource as IList).AddRange(payload.DraggedAppointments);
				}
			}
		}
 
		private ContentControl CreateDragCue(IEnumerable<IOccurrence> appointments)
		{
			bool isHorizontal = this.EffectiveOrientation == Orientation.Horizontal;
			double ticksPerPixel = this.EffectivePixelLength.Ticks;
 
			StackPanel panel = new StackPanel();
			panel.Orientation = this.EffectiveOrientation;
			panel.Background = new SolidColorBrush() { Color = Colors.Transparent };
 
			foreach (IOccurrence appointment in appointments)
			{
				double lenght = appointment.Duration().Ticks / ticksPerPixel;
 
				AppointmentCueItem item = new AppointmentCueItem();
				item.HorizontalContentAlignment = HorizontalAlignment.Stretch;
				item.VerticalContentAlignment = VerticalAlignment.Stretch;
				item.Height = isHorizontal ? 110 : lenght;
				item.Width = isHorizontal ? lenght : 110;
				item.Content = appointment;
				item.ContentTemplate = this.AppointmentTemplate;
 
				panel.Children.Add(item);
			}
 
			ContentControl cue = new ContentControl();
			cue.Content = panel;
 
			return cue;
		}
	}
}

And I have the following xaml definitions for the listbox and schedule view:

        <telerik:RadScheduleView Name="radScheduleView1"
                                 EditAppointmentDialogStyle="{StaticResource EditAppointmentDialogStyle}"
                                 Grid.Column="1"
                                 AppointmentItemContentTemplate="{StaticResource AppointmentItemContentTemplate}"
                                 GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}">
            <telerik:RadScheduleView.ViewDefinitions>
                <my:DayViewDefinition />
                <my:WeekViewDefinition />
                <my:MonthViewDefinition />
                <my:TimelineViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
 
            <scheduleView:RadScheduleView.GroupDescriptionsSource>
                <scheduleView:GroupDescriptionCollection>
                    <scheduleView:ResourceGroupDescription ResourceType="Operatives" />
                </scheduleView:GroupDescriptionCollection>
            </scheduleView:RadScheduleView.GroupDescriptionsSource>
 
        </telerik:RadScheduleView>
 
        <ListBox AllowDrop="True" ItemsSource="{Binding}" Name="listBox1"
                 ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}"
                 ItemTemplate="{StaticResource ListBoxItemTemplate}" SelectionMode="Extended"
                 HorizontalAlignment="Left" Width="270">
            <local:ListBoxDragDropBehavior.Behavior>
                <local:ListBoxDragDropBehavior EffectivePixelLength="{Binding EffectivePixelLength, ElementName=radScheduleView1}"
                                               EffectiveOrientation="{Binding EffectiveOrientation, ElementName=radScheduleView1}"
                                               AppointmentTemplate="{Binding DragVisualCueItemTemplate, ElementName=radScheduleView1}" />
            </local:ListBoxDragDropBehavior.Behavior>
            <ListBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                    <GradientStop Color="#FF4B4B4B" Offset="1" />
                    <GradientStop Color="#FF6E6E6E" />
                </LinearGradientBrush>
            </ListBox.Background>
        </ListBox>

I could really do with cracking this problem ASAP as I have deadlines to meet very soon, I really really appreciate any help you can give.

Thanks,

Dan
Valeri Hristov
Telerik team
 answered on 25 Oct 2011
2 answers
381 views
Hi, can someone tell me how (or maybe it's not possible) to center the content inside the RadRibbonButton? The text and image I set is always left justified for some reason. For each button I add to the tab (or group) I have a large image and text. I would like to center this if possible. HorizontalContentAlignment doesn't seem to do anything.

Example:
RadRibbonButton button = new RadRibbonButton();
ImageSource imgs = ResourceLoader.GetResourceImage(buttonModel.AssemblyViewFileName, buttonModel.ButtonIconResourceName);
 
button.LargeImage = imgs;
button.Size = Telerik.Windows.Controls.RibbonView.ButtonSize.Large;
button.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
button.VerticalContentAlignment = System.Windows.VerticalAlignment.Center;

Or
<telerikRibbon:RadRibbonGroup Header="Common">
                    <telerikRibbon:RadRibbonButton Text="Home" LargeImage="/Resources/Home32.png" Width="70" Size="Large" HorizontalContentAlignment="Center" />
                </telerikRibbon:RadRibbonGroup>

Tina Stancheva
Telerik team
 answered on 25 Oct 2011
1 answer
163 views
Hello,

Practically identical to a thread opened recently for the Silverlight control...

Rather than have the zoom controller on the Image Editor UI default to a value of "100%," I'd like to have the option to default its value to "Auto." Is this property currently implemented and I just don't see it?

Thank you,
Kyle
Iva Toteva
Telerik team
 answered on 25 Oct 2011
1 answer
92 views
Hi,

I want to get all the appointments within the visible range of the scheduleview. If it is day view, all the appointments in that day and if is weekview all the appointments occur in that week..Please help...

With Regards,
Jeyakumar
Valeri Hristov
Telerik team
 answered on 25 Oct 2011
5 answers
474 views
I specified the SelectionBoxTemplate on my ComboBox, but its being ignored. My code is:
<ti:RadComboBox Name="CodeComboBox" Margin="5,0,0,0" MinWidth="80"
            tc:StyleManager.Theme="Office_Blue"
            IsEditable="True"
            ItemsSource="{Binding DataView}"
            DisplayMemberPath="{Binding DisplayColumnName}"
            SelectedValuePath="{Binding KeyColumnName}"
            SelectedItem="{Binding SelectedView}">
         <ti:RadComboBox.SelectionBoxTemplate>
              <DataTemplate>
                  <TextBox Text="Hows it going" Background="Green"/>
              </DataTemplate>
          </ti:RadComboBox.SelectionBoxTemplate>
</ti:RadComboBox>

Am I doing something wrong?
George
Telerik team
 answered on 25 Oct 2011
1 answer
156 views
Hi Telerik,

I am very new to wpf telerik controls. I am using richtextbox. I learn how to add customize text from code behind. But how can I add customize text from ViewModel.

Regards

Animesh
Iva Toteva
Telerik team
 answered on 25 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
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
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?