We got problem (or maybe an issue) in the RadListBox with enabled Drag&Drop. In our Project we simply want to Drag&Drop Customers from a RadListBox to a RadScheduleView. For displaying the customer business objects into the list we use a simple data-template.
If we compile the project without the line 33 into the MainWindow.xaml the items are shown into the listbox. If we use the line, the items disappear, but the listbox could be used as drop-target from the calendar.
The problem occurred with the telerik wpf version 2016.3.914.45.NoXaml (folder-name of the library linked to the project) and the office 2016 style. We found out, that the problem was not reproducible with an older telerik version or another theme.
Is there any workaround or fix? Thank you for your help.
I attached the demo-project with the problem as zip-file with a password, for making it possible for you to reproduce the problem I attached the whole telerik classes. Because this the file is password covered. If you want to unpack the file, please request the password per e-mail.
App.xaml
01.
<
Application
x:Class
=
"TestApp1.App"
03.
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
04.
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
05.
StartupUri
=
"MainWindow.xaml"
>
06.
<
Application.Resources
>
07.
<
ResourceDictionary
>
08.
<
ResourceDictionary.MergedDictionaries
>
09.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2016;component/Themes/System.Windows.xaml"
/>
10.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.xaml"
/>
11.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Input.xaml"
/>
12.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Navigation.xaml"
/>
13.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"
/>
14.
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.ScheduleView.xaml"
/>
15.
</
ResourceDictionary.MergedDictionaries
>
16.
</
ResourceDictionary
>
17.
</
Application.Resources
>
18.
</
Application
>
MainWindow.xaml
01.
<
Window
x:Class
=
"TestApp1.MainWindow"
03.
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
04.
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
05.
xmlns:local
=
"clr-namespace:TestApp1"
06.
xmlns:drag
=
"clr-namespace:Telerik.Windows.DragDrop.Behaviors;assembly=Telerik.Windows.Controls"
07.
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
08.
09.
<
Window.Resources
>
10.
<
Style
x:Key
=
"DraggableListBoxItem"
TargetType
=
"telerik:RadListBoxItem"
>
11.
<
Setter
Property
=
"telerik:DragDropManager.AllowCapturedDrag"
Value
=
"True"
/>
12.
<
Setter
Property
=
"telerik:DragDropManager.AllowDrag"
Value
=
"True"
/>
13.
</
Style
>
14.
<
DataTemplate
x:Key
=
"CustomerItem"
>
15.
<
TextBlock
Foreground
=
"Blue"
Text
=
"{Binding Name}"
/>
16.
</
DataTemplate
>
17.
</
Window.Resources
>
18.
19.
<
Window.DataContext
>
20.
<
local:ViewModel
/>
21.
</
Window.DataContext
>
22.
23.
<
Grid
>
24.
<
Grid.ColumnDefinitions
>
25.
<
ColumnDefinition
Width
=
"5*"
/>
26.
<
ColumnDefinition
Width
=
"5*"
/>
27.
</
Grid.ColumnDefinitions
>
28.
29.
<
telerik:RadListBox
x:Name
=
"ListBox"
30.
AllowDrop
=
"False"
31.
ItemsSource
=
"{Binding CustomersSource}"
32.
ItemTemplate
=
"{StaticResource CustomerItem}"
33.
ItemContainerStyle
=
"{StaticResource DraggableListBoxItem}"
>
34.
<
telerik:RadListBox.DragVisualProvider
>
35.
<
telerik:ScreenshotDragVisualProvider
/>
36.
</
telerik:RadListBox.DragVisualProvider
>
37.
<
telerik:RadListBox.DataConverter
>
38.
<
local:AppointmentToCustomerConverter
/>
39.
</
telerik:RadListBox.DataConverter
>
40.
<
telerik:RadListBox.DragDropBehavior
>
41.
<
telerik:ListBoxDragDropBehavior
AllowReorder
=
"True"
telerik:DragDropManager.TouchDragTrigger
=
"TapAndHold"
/>
42.
</
telerik:RadListBox.DragDropBehavior
>
43.
</
telerik:RadListBox
>
44.
45.
<
telerik:RadScheduleView
x:Name
=
"scheduleView"
46.
Grid.Column
=
"1"
47.
AppointmentsSource
=
"{Binding AppointmentsSource}"
>
48.
<
telerik:RadScheduleView.ViewDefinitions
>
49.
<
telerik:WeekViewDefinition
/>
50.
</
telerik:RadScheduleView.ViewDefinitions
>
51.
<
telerik:RadScheduleView.DragDropBehavior
>
52.
<
local:ScheduleViewDragDropBehavior
/>
53.
</
telerik:RadScheduleView.DragDropBehavior
>
54.
</
telerik:RadScheduleView
>
55.
</
Grid
>
56.
</
Window
>
ViewModel.cs
01.
using
System;
02.
using
System.Collections;
03.
using
System.Collections.Generic;
04.
using
System.Collections.ObjectModel;
05.
using
System.Linq;
06.
using
System.Text;
07.
using
Telerik.Windows.Controls;
08.
using
Telerik.Windows.Controls.ScheduleView;
09.
using
Telerik.Windows.DragDrop.Behaviors;
10.
11.
namespace
TestApp1
12.
{
13.
public
class
Customer
14.
{
15.
public
string
Name {
get
;
set
; }
16.
}
17.
18.
public
class
ViewModel : ViewModelBase
19.
{
20.
private
ObservableCollection<Customer> customersSource;
21.
private
ObservableCollection<Appointment> appointmentsSource;
22.
23.
public
ViewModel()
24.
{
25.
this
.CustomersSource =
new
ObservableCollection<Customer> {
26.
new
Customer{ Name =
"Customer 1"
},
new
Customer{ Name =
"Customer 2"
},
new
Customer{ Name =
"Customer 3"
},
27.
new
Customer{ Name =
"Customer 4"
},
new
Customer{ Name =
"Customer 5"
},
new
Customer{ Name =
"Customer 6"
},
28.
new
Customer{ Name =
"Customer 7"
},
new
Customer{ Name =
"Customer 8"
},
new
Customer{ Name =
"Customer 9"
},
29.
};
30.
this
.AppointmentsSource =
new
ObservableCollection<Appointment>();
31.
}
32.
33.
public
ObservableCollection<Customer> CustomersSource
34.
{
35.
get
{
return
customersSource; }
36.
set
{ customersSource = value;
this
.OnPropertyChanged(
"CustomersSource"
); }
37.
}
38.
39.
public
ObservableCollection<Appointment> AppointmentsSource
40.
{
41.
get
{
return
appointmentsSource; }
42.
set
{ appointmentsSource = value;
this
.OnPropertyChanged(
"AppointmentsSource"
); }
43.
}
44.
}
45.
public
class
ScheduleViewDragDropBehavior : Telerik.Windows.Controls.ScheduleViewDragDropBehavior
46.
{
47.
public
object
customers {
get
;
set
; }
48.
public
override
IEnumerable<IOccurrence> ConvertDraggedData(
object
data)
49.
{
50.
if
(DataObjectHelper.GetDataPresent(data,
typeof
(Customer),
false
))
51.
{
52.
var customers = DataObjectHelper.GetData(data,
typeof
(Customer),
true
)
as
IEnumerable;
53.
if
(customers !=
null
)
54.
{
55.
var newApp = customers.OfType<Customer>().Select(c =>
new
Appointment { Subject = c.Name });
56.
return
newApp;
57.
}
58.
}
59.
return
base
.ConvertDraggedData(data);
60.
}
61.
}
62.
public
class
AppointmentToCustomerConverter : DataConverter
63.
{
64.
public
override
string
[] GetConvertToFormats()
65.
{
66.
return
new
string
[] {
typeof
(ScheduleViewDragDropPayload).FullName,
typeof
(Customer).FullName };
67.
}
68.
public
override
object
ConvertTo(
object
data,
string
format)
69.
{
70.
var payload = DataObjectHelper.GetData(data,
typeof
(ScheduleViewDragDropPayload),
false
)
as
ScheduleViewDragDropPayload;
71.
if
(payload !=
null
)
72.
{
73.
var customers = payload.DraggedAppointments;
74.
return
customers.OfType<Appointment>().Select(a =>
new
Customer { Name = a.Subject });
75.
}
76.
return
null
;
77.
}
78.
}
79.
}
Hello everybody,
We need to create own implementation of RadGrid server filtering and sorting without using OData Web Services.
So, if the user choose filter from GridView, we want to create query to our custom Web Service. Web Service will return filtered and sorted data.
RadGrid shouldn't filter data by self.
We've try to write own implementation of QueryableCollectionView and use it as grid ItemsSource. Our collection implements ICollectionView, IQueryableCollectionView.
Unfortunately doesn't work. RadGrid is still filtering data in memory.
Please help.
I've like to start with a blank LayoutControl and allow a user to drop UI Elements onto it. Are there any examples on how this could be done?
Thanks
Hi,
I have a sample project that uses the RadRichTextBox and RadRichTextBoxRibbonUI controls. I'm using the Office2016 theme with NoXaml binaries. I was referencing the assemblies directly in the install directory:
C:\Program Files (x86)\Progress\Telerik UI for WPF R2 2019\Binaries.NoXaml\WPF45\Telerik.Windows.Themes.Office2016.dll
...and this all worked fine . I've since run the upgrade wizard to bump up to R1 2020 and this moved everything locally in the lib folder. Everything works as before with the exception of the RichTextBox, which does not render (the ribbon and other controls all render fine). If you check Mole you can see the top level element for the RichTextBox but it has no children and the control does not render.
One thing I notice, looking at the R1 2020 version of Office2016.dll in JustDecompile, is that the baml for richtextboxui seems to produce a parser exception:
Current member / type: themes/telerik.windows.controls.richtextboxui.baml
File path: C:\Program Files (x86)\Progress\Telerik UI for WPF R1 2020\Binaries.NoXaml\WPF45\Telerik.Windows.Themes.Office2016.dll
Product version: 2019.1.118.0
Character '0' was unexpected in string '0'. Invalid XAML type name.
at MS.Internal.Xaml.Parser.MeScanner.ResolveTypeName(String longName)
at MS.Internal.Xaml.Parser.MeScanner.Read()
at MS.Internal.Xaml.Parser.MePullParser.<P_MarkupExtension>d__9.MoveNext()
at MS.Internal.Xaml.Parser.MePullParser.<P_Value>d__13.MoveNext()
This is not the case for the same baml file in the equivalent R2 2019 assembly, which displays the xaml you'd expect.
Is this a known issue, or am I missing something else?
Many thanks
John
With the release 2020.1.115 the following changes were made:
The RowValidating event is now fired when the UI virtualization prepares a row to be shown in the viewport. There is a new value in the GridViewEditOperationType enum - None for this specific case.
I need the behaviour before this release. So when UI virtualization prepares a row to be shown in the viewport the validation should not take place. Only when a cell was edited / changed. I need the ValidationResults which are not provided in RowEditEnded Event.
What do I have to change in this case?
Shape DragEnter doesn't work like ContainerShape does
RadDiagramContainerShape has OnDragEnter Event. so, on Diagram, if i drag shape into Containershape then DragEnter, DragOver, DragLeave are worked.
but Shape doesn't have DragEnter and DragOver.
i want to do senario if shape is dragged to other shape then other shape's DragEnter event is activated.
i tried to handle DragEnter on shape,
"DragDropManager.AddDragEnterHandler(this, MyDragEnterEventMethod);" in Customshape implements RadDiagramShape,
but, MyDragEnterEventMethod doesn't work when shape is dragged to other shape on Diagram.
MyDragEnterEventMethod only work when control DragContent to DragDropManager.AddDragInitializeHandler.
DragDropManager.AddDragInitializeHandler Code is below
DragDropManager.AddDragInitializeHandler(this.diagram, OnDragSourceDragInitialize);
and OnDragSourceDragInitialize Code is below
private void OnDragSourceDragInitialize(object sender, DragInitializeEventArgs e)
{
this.dragVisualControl.Content = this.PrepareDragVisualTypeB(e.OriginalSource as RadDiagramShape);
e.DragVisual = this.dragVisualControl;
e.DragVisualOffset = e.RelativeStartPoint;
e.AllowedEffects = DragDropEffects.All;
}
How do i Activate Shape DragEnter, DragOver, DragLeave like ContainerShape does?
i need to cases
case 1. when it dragged "Shape1" to "Shape2", "Shape2"'s Drag Enter is activated.
case 2. when it dropped "Shape1" to "Shape2", "Shape2"'s Drop Event is activated.
Hi,
in 2018.2.515.45 version of telerik RadGridView I did:
var col =
new
GridViewDataColumn() { DataMemberBinding =
new
Binding(item.Name), Header = header };
col.CellStyle =
new
Style();
col.CellStyle.Setters.Add(
new
Setter(GridViewCell.FontWeightProperty, FontWeights.Bold));
MyRadGridView.Columns.Add(col);
to set the font of a certain column to bold. Now, after update to 2020.1.115.45 version this is not working any more. The content of this column is invisible.
I tried this:
col.CellStyle =
new
Style() { TargetType =
typeof
(GridViewCell) };
but no changes.
How can I add a setter to the style in new version?
BR Gert
Hi,
is it possible to enter 030120 but have the Preview ToolTip in format dd.MM.yyyy and also wenn leaving the control (d1.jpg, d2.jpg, d3.jpg, d4.jpg)?
BR Gert