Hi,
When I try to select C:\ drive as the destination folder (a.k.a FileName property) in RadOpenFolderDialog, it gets set to the location of the application it's running.
This only happens for C:\ drive and no other drives (e.g. D:\) or the subfolders in C:\ drive (e.g. C:\path).
Also, when I select C from "This PC", the destination correctly gets set to C (first attached file), but when when I select C while in C drive it gets incorrectly set (second attached file).
Is there any known issue about this?
To make entire tile area draggable, I applied following behavior on RadTileView-
<telerik:RadTileView IsItemsAnimationEnabled="False" x:Name="myTileView"
ItemsSource="{Binding AvailableChartList,UpdateSourceTrigger=Explicit}"
telerik:RadTileView.ItemContainerStyle="{DynamicResource RadTileViewItemStyle1}"
MaximizeMode="Zero">
<i:Interaction.Behaviors>
<local:RadTilesDragDropBehavior/>
</i:Interaction.Behaviors>
</telerik:RadTileView>
-----Behavior------
public class RadTilesDragDropBehavior : Behavior<RadTileView>
{
private int DragedElementInitialPosition;
private bool isDragging;
private int endPosition = -1;
private RadTileViewItem dragElement;
protected override void OnAttached()
{
base.OnAttached();
// Insert code that you would want run when the Behavior is attached to an object.
DragDropManager.AddDragInitializeHandler(AssociatedObject, OnDragInitialize);
DragDropManager.AddDragDropCompletedHandler(AssociatedObject, OnDragAndDropCompleted);
AssociatedObject.PreviewDragOver += MyTileView_PreviewDragOver;
AssociatedObject.PreviewTilePositionChanged += RadTileView_PreviewTilePositionChanged;
}
private void RadTileView_PreviewTilePositionChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
if (this.isDragging)
{
e.Handled = true;
var container = e.OriginalSource as RadTileViewItem;
if (container == this.dragElement)
{
this.endPosition = container.Position;
}
}
}
private void OnDragInitialize(object sender, DragInitializeEventArgs args)
{
this.isDragging = true;
var tileView = sender as RadTileView;
var tileViewItem = args.OriginalSource as RadTileViewItem;
this.dragElement = tileViewItem;
this.DragedElementInitialPosition = dragElement.Position;
if (tileViewItem != null && tileView != null)
{
args.Data = tileViewItem;
var draggingItem = new RadTileViewItem
{
Style=AssociatedObject.Resources["RadTileViewItemStyle1"] as Style,
Width = tileViewItem.RestoredWidth,
Height = tileViewItem.RestoredHeight
};
args.DragVisual = draggingItem;
tileViewItem.Opacity = 100;
args.AllowedEffects = DragDropEffects.Move;
args.Handled = true;
}
}
private void OnDragAndDropCompleted(object sender, DragDropCompletedEventArgs args)
{
if (args.OriginalSource.GetType() == typeof(RadTileViewItem))
{
this.isDragging = false;
Point pt = Util.CorrectGetPosition((RadTileView)sender);
HitTestResult result = VisualTreeHelper.HitTest(AssociatedObject, pt);
if (result != null)
{
DependencyObject obj = result.VisualHit.ParentOfType<RadTileViewItem>();
if (obj != null)
{
endPosition=((RadTileViewItem)obj).Position;
RadTileView parent = args.Source as RadTileView;
IEnumerable<RadTileViewItem> itemsToMove = null;
if (this.endPosition != -1)
{
if (this.DragedElementInitialPosition < this.endPosition)
{
var itemsCollection = ((IList<ChartDetail>)parent.ItemsSource);
itemsToMove = itemsCollection
.Select(i => parent.ItemContainerGenerator.ContainerFromItem(i) as RadTileViewItem)
.Where(c => c.Position > this.DragedElementInitialPosition && c.Position <= this.endPosition)
.OrderBy(c => c.Position);
foreach (var item in itemsToMove)
{
item.Position--;
}
}
else
{
for (int i = 0; i < this.DragedElementInitialPosition - this.endPosition; i++)
{
this.dragElement.Position--;
}
}
}
this.endPosition = -1;
}
else
{
draggingTile.Opacity = 100;
}
}
else
{
draggingTile.Opacity = 100;
}
}
}
private void MyTileView_PreviewDragOver(object sender, System.Windows.DragEventArgs e)
{
FrameworkElement container = sender as FrameworkElement;
if (container == null)
{
return;
}
double tolerance = 60;
double verticalPos = Util.CorrectGetPosition((RadTileView)container).Y;
double offset = 20;
ScrollViewer scrollViewer = AssociatedObject.FindChildByType<ScrollViewer>();
if (verticalPos < tolerance) // Top of visible list?
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - offset); //Scroll up.
}
else if (verticalPos > container.ActualHeight - tolerance) //Bottom of visible list?
{
scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + offset); //Scroll down.
}
}
protected override void OnDetaching()
{
base.OnDetaching();
// Insert code that you would want run when the Behavior is removed from an object.
DragDropManager.RemoveDragInitializeHandler(AssociatedObject, OnDragInitialize);
DragDropManager.RemoveDragDropCompletedHandler(AssociatedObject, OnDragAndDropCompleted);
AssociatedObject.PreviewDragOver -= MyTileView_PreviewDragOver;
AssociatedObject.PreviewTilePositionChanged -= RadTileView_PreviewTilePositionChanged;
}
}
If I drag Tile By clicking anywhere on the tile and drop anywhere on the RadTileView, it works fine.
But If I try to drag the Tile by clicking on the header area(RadTileViewItem's default draggable area) and drop the tile out of RadTileView, Tile vanishes from the view. (Please refer the attached image to see the issue.)
Please, suggest a way to fix this issue or if there is any other way to make entire tile draggable.
Hello,
I have some problem with Export to Excel for DateTime Format Columns.
Set Column Format:
(
this
.myGrid.Columns[
"JPr_MinStart"
]
as
GridViewDataColumn).DataFormatString =
"dd/MM/yyyy hh:mm"
;
On ElementExportingToDocument:
01.
private
void
myGrid_ElementExportingToDocument(
object
sender, GridViewElementExportingToDocumentEventArgs e)
02.
{
03.
if
(e.Element == ExportElement.Cell)
04.
{
05.
var cellExportingArgs = e
as
GridViewCellExportingEventArgs;
06.
if
(
07.
(cellExportingArgs.Column
as
GridViewDataColumn).UniqueName ==
"JPr_MinStart"
08.
)
09.
{
10.
(cellExportingArgs.Column
as
GridViewDataColumn).DataFormatString =
string
.Empty;
11.
var parameters = cellExportingArgs.VisualParameters
as
GridViewDocumentVisualExportParameters;
12.
parameters.Style =
new
CellSelectionStyle()
13.
{
14.
Format =
new
CellValueFormat(
"dd/MM/yyyy hh:mm"
)
15.
};
16.
}
17.
}
18.
}
On ElementExportedToDocument
private
void
myGrid_ElementExportedToDocument(
object
sender, GridViewElementExportedToDocumentEventArgs e)
{if
(e.Element == ExportElement.Table)
{
(this.myGrid.Columns["JPr_MinStart"] as GridViewDataColumn).DataFormatString = "dd/MM/yyyy hh:mm";
}
}
If I set DateFormatString, the export to Excel is wrong. It export the value as String and Excel cannot recognize the DateTime column.
If i remove DateFormatString on Exporting and on Exported I set the DateFormat string, the Excel is right but the first line no!
I think that is a bug? My WPF version is: 2018.1.220.40
Thank you very much
editor.Document.StyleRepository.Clear();
foreach
(var style
in
editor.Document.StyleRepository)
editor.Document.StyleRepository.Remove(style);
foreach
(var style
in
editor.Document.StyleRepository)
style.IsPrimary =
false
;
Hi,
In 001.png,how to change the background of the cells when I press and hold the mouseleftbutton?
the selectionUnit is cell,and the selectionMode is extended.
Hello.
I need directly selected the path like 'DeskTop', 'Videos' or other in the custom place pane sometimes in my application.
Is there has a way to return the selected custom place path in custom place pane?
Hello,
MergedCellsStyle of my RadGridView is below.I want to chenge the background of the mergedCell when it is selected.But the code dose not work.
How to achieve that?
Thanks.
<Style x:Key=
"GridViewMergedCell1"
TargetType=
"telerik:GridViewMergedCell"
>
<Setter Property=
"ContentTemplate"
>
<Setter.Value>
<DataTemplate>
<StackPanel>
<TextBlock Text=
"{Binding}"
Foreground=
"Black"
HorizontalAlignment=
"Center"
VerticalAlignment=
"Center"
FontWeight=
"Bold"
/>
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property=
"Background"
Value=
"AliceBlue"
/>
<Style.Triggers>
<Trigger Property=
"IsSelected"
Value=
"True"
>
<Setter Property=
"Background"
Value=
"AliceBlue"
/>
</Trigger>
</Style.Triggers>
</Style>
I'm trying to only allow users to type in 6 digits integer with prefix "CA", and now I can only type in one leading zero, not multiple zeros.
Here is my code, and ProjectNumber is a nullable double.
<telerik:RadMaskedNumericInput
Grid.Column="0"
Margin="25, 0, 0, 10"
Width="100"
Mask="CA#####"
Placeholder=""
AutoFillZeros="False"
AutoFillNumberGroupSeparators ="False"
IsClearButtonVisible="False"
AllowInvalidValues="True"
Validation.ErrorTemplate="{x:Null}"
maskedInput:MaskedInputExtensions.Minimum="0"
HorizontalContentAlignment="Left"
HorizontalAlignment="Left"
Value="{Binding Path=(viewModel:IProjectFolderViewModel.ProjectNumber), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
Also, the prefix 'CA' only appears after users click on the input box or type in something. is there anyway that we could show the prefix all the time.