Telerik Forums
UI for WPF Forum
2 answers
155 views

Short question: is there a way to display the values of my datapoints in RadLegend besides the title? What I like to see is something like this:

coloured_rectangle -- DataPoint-Value -- DataPoint-Label

Regards
Heiko

Vladimir Stoyanov
Telerik team
 answered on 26 Mar 2020
5 answers
794 views

This is probably just me not knowing how to make this control do this but...

I have a list of items and in-code I'm selecting an item that off-screen but RadListView doesn't auto-scroll to that item.  it IS selected just not in view.

Do I have to do something like:  radListView1.ShowSelectedItem(someRadListDataItem)

or perhaps from the item itself?  Something that works like this:  someRadListDataItem.EnsureVisible = True

??

 

Any help would be appreciated.

-c

Dinko | Tech Support Engineer
Telerik team
 answered on 26 Mar 2020
3 answers
211 views

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?

Vladimir Stoyanov
Telerik team
 answered on 25 Mar 2020
4 answers
227 views

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.

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 25 Mar 2020
1 answer
388 views

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

Martin Ivanov
Telerik team
 answered on 24 Mar 2020
1 answer
90 views
When we click the pin button we expect to see all the panes in the group hidden or pinned.  Instead we are seeing the individual panes being pinned or unpinned.  Is there a way to override this functionality?
Vladimir Stoyanov
Telerik team
 answered on 24 Mar 2020
1 answer
235 views
I want the first column to be the row header, or some way of defining the row header.  I'm auto generating the columns because I have a dynamic number of columns.  Any ideas?
Vladimir Stoyanov
Telerik team
 answered on 24 Mar 2020
6 answers
465 views
Hello,

i want to remove all Styles from the StyleRepository of the current RadDocument and add my own StyleDefinitions.

The adding of StyleDefinitions works fine, but I can't remove the standard Style.
I tried it with
editor.Document.StyleRepository.Clear();
or
foreach (var style in editor.Document.StyleRepository)
editor.Document.StyleRepository.Remove(style);
or
foreach (var style in editor.Document.StyleRepository)
style.IsPrimary = false;

But allways threre are more Styles than my own in the StyleGallery.
Dimitar
Telerik team
 answered on 24 Mar 2020
2 answers
129 views

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.

guo
Top achievements
Rank 1
 answered on 24 Mar 2020
3 answers
105 views

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?

Martin Ivanov
Telerik team
 answered on 23 Mar 2020
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?