Telerik Forums
UI for WPF Forum
1 answer
218 views
Hi,

I'm trying to add drag and drop behavior to RadTreeListView like this:
        <Style TargetType="telerik:RadTreeViewItem" x:Key="TreeViewItemStyle">
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
            <Setter Property="telerik:DragDropManager.AllowDrag" Value="True"/>
            <Setter Property="telerik:RadDragAndDropManager.AllowDrop" Value="True" />
        </Style>
....
 <telerik:RadTreeListView  x:Name="TestScriptTreeListView"
SelectedItem="{Binding TestViewItem.SelectedScriptActionViewItem, Mode=TwoWay}"  
ItemContainerStyle="{StaticResource TreeViewItemStyle}"
IsDragDropEnabled="True"
AllowDrop="True"
ItemsSource="{Binding Source={StaticResource scriptActionSorted}}"
behavior:TestScriptDragDropBehavior.UseTestScriptDragDrop="True"">

and in the behavior I tried to register to the events like this:
private static void StartUseDragDrop(RadTreeListView treeListView)
    {
      DragDropManager.AddDragInitializeHandler(treeListView, OnDragInitialize);
      DragDropManager.AddGiveFeedbackHandler(treeListView, OnGiveFeedback);
      DragDropManager.AddDropHandler(treeListView, OnDrop);
      DragDropManager.AddDragDropCompletedHandler(treeListView, OnDragDropCompleted);
      DragDropManager.AddDragOverHandler(treeListView, OnDragOver);
      //this is just to try and stop
      DragDropManager.AddPreviewDragEnterHandler(treeListView, DragEnter2);
      DragDropManager.AddPreviewDragOverHandler(treeListView, OnDragOver2);
      DragDropManager.AddPreviewDropHandler(treeListView, OnDrop2);
      DragDropManager.AddPreviewGiveFeedbackHandler(treeListView, OnGiveFeedback2);*/
       
    }

the problem is that the only events that are called are the preview events and no the actual regular events. The only event that is called is the "OnDragDropCompleted" event. how can i make it call the regular events also?


Yoan
Telerik team
 answered on 24 May 2013
3 answers
139 views
I am trying to adjust the template of RadDatePicker to add today button, I modified the template included below.  But I can not get it to respect the theme.  The rad button I added respect the theme not the calendar.   I have couple of questions:

  • How can I change the template to respect the theme selected for the application?
  • How can I hook up the today button to select the today's date.
  • Do I need to include the entire tempatle?

Hope you can provide some help.
Vladi
Telerik team
 answered on 24 May 2013
1 answer
534 views
We have a client where we are showing a RadCartesianChart where the horizontal axis has a year's worth of weekly data (53 data points).

The client is wishing to model a feature present in a legacy application built against ChartFX where the user is able to click a button to a preset Zoom and PanOffest of a quarter's worth of data (13 datapoints).

I've created a spike where I'm displaying the Zoom and PanOffset, and where I can set the values as well - here's where I'm at now.  Problem is that depending on the monitor size or whether the application is maximized or windowed at some custom size, the PanOffset value can differ.

I'm assuming I somehow need to get the width of the chart, set the Zoom to (4,1) and the PanOffset would need to be calculated based upon the width of the chart or maybe just the chart axis?  HorizontalAxis.ActualWidth appears to be returning zero.

For example, in the view model command handler for clicking the Q2 button I have - but again - these hard-coded values don't work properly if the application is a different size.

#region PresetQuarter2Command
private readonly ICommand _PresetQuarter2Command;
/// <summary>
/// Command binding.
/// </summary>
public ICommand PresetQuarter2Command { get { return _PresetQuarter2Command; } }
/// <summary>
/// Action method.
/// </summary>
public void PresetQuarter2()
{
    var zoomSize = new Size(3.79, 1);
    var pointOffset = new Point(-1138.65, 0);
    this.Zoom = zoomSize;
    this.PanOffset = pointOffset;
}
/// <summary>
/// CanExecute method.
/// </summary>
/// <returns>True if the command can be executed, otherwise false.</returns>
public bool CanPresetQuarter2()
{
    return true;
    // Example of how to trigger the calling of this method
    //((DelegateCommand)PresetQuarter2Command).RaiseCanExecuteChanged();
}
#endregion

Can you give me some direction on this?

Petar Marchev
Telerik team
 answered on 24 May 2013
1 answer
236 views
Hello,

All of the examples I could find about Line Series LegendSettings are shown in the xaml markup. Is there a way to set the Title property in code?

XAML:
<telerik:LineSeries.LegendSettings>
           <telerik:SeriesLegendSettings Title="Sold"/>
 </telerik:LineSeries.LegendSettings>

C#:
LineSeries units = new LineSeries() { LegendSettings = ? };

Thanks,

Johnny
Ves
Telerik team
 answered on 24 May 2013
1 answer
95 views
I am trying to convert a bit of code from the old RadDragAndDropManager to the new DragDropManager but the documentation is really lacking and I'm having a lot of trouble figuring out what to do.

I just have a simple function that determines whether or not the user can drop a node in a RadTreeView.  I feel like this should be simple to replicate with DragDropManager, but I'm just missing something:

Tree.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler<DragDropQueryEventArgs>(Tree_DragQuery), true);
 
private void Tree_DragQuery(object sender, DragDropQueryEventArgs e)
{
    var targetTvi = e.Options.Destination as RadTreeViewItem;
    var sourceTvi = e.Options.Source as RadTreeViewItem;
 
    if (targetTvi == null || sourceTvi == null)
    {
        return;
    }
 
    if (sourceTvi.DataContext is LayerTviVM && targetTvi.DataContext is LayerTviVM)
    {
        e.QueryResult = true;
    }
    else if (sourceTvi.DataContext is ImageTviVM && targetTvi.DataContext is ImageTviVM)
    {
        // We only support drag & drop of images within the same layer
        e.QueryResult = (sourceTvi.ParentItem == targetTvi.ParentItem);
    }
    else
    {
        e.QueryResult = false;
    }
}
Yoan
Telerik team
 answered on 24 May 2013
1 answer
109 views
First off, I am on version 2010.3.1314.35 and cannot upgrade at this time.  When using a GridView with a column bound to a

System.Nullable<double> property, I have a couple issues.  One issue is that it allows the user to type anything in the field.  Not just decimal numbers.  I tried to solve this by using cell validating, but when I type a character and tab out of the field, before validating fires it tries to update the bound item (2 way binding is on) and throws a format exception because the character value cannot be put into the double? property. 

The other issue is, since it is nullable, I would also like to allow the user to leave the field blank and it assign null to the bound property.  Is this possible or am I going to have to unbind the column and manually update accordingly?

,
Dimitrina
Telerik team
 answered on 24 May 2013
4 answers
189 views
Hello,

I'm evaluating telerik controls now, and my company will purchase in this month.

I want to know how to save multiple diagram pages with MVVM. (You can see this scenario in a attached screenshot)

Your document and sample is only showing "RadDiagram.Save()" to save a diagram, but my application is generating  a diagram dynamically for each tab content.

In this case, SerializableGraphSource doesn't know what diagram is connected with it.
And a diagram instance will be destroyed and recreated when tab control selection is changed.

Should I make my own save/load functions for this? 
I would appreciate if you give me some advice.

Thank you.
Hyunho
Top achievements
Rank 1
 answered on 24 May 2013
1 answer
148 views
Hi,
Is it possible to center and zoom in the diagram to a particular shape?

I've been trying to use a shape's Position as a parameter in the Diagram's ZoomIn() function, but it's not working as expected. When I first zoom to a shape, that shape is correctly centered in view. Subsequent zooms to other shapes don't work as well - the view is completely off. I guess ZoomIn() doesn't use the same coordinate system as Diagram Shapes, so the Position is something different at different zoom levels.

Maybe there's a "FocusOnShape()" function that I haven't yet found?
Vivek
Top achievements
Rank 1
 answered on 23 May 2013
2 answers
224 views
I have a Cartesian chart as follows:

<telerik:RadCartesianChart x:Name="chart" Grid.Column="0">
    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries ItemsSource="{Binding DataItems}" ValueBinding="Value" CategoryBinding="DayPeriod" >
            <telerik:BarSeries.PointTemplate>
                <DataTemplate>
                    <Rectangle Fill="{Binding Converter={StaticResource BrushConverter}, ConverterParameter={StaticResource brushes}}"/>
                </DataTemplate>
            </telerik:BarSeries.PointTemplate>
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Minimum="{Binding MinValue}" Maximum="{Binding MaxValue}" MajorStep="{Binding StepSize}" LabelStyle="{StaticResource axisLabelStyle}" />
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis LabelFitMode="Rotate" LabelInterval="2"/>
    </telerik:RadCartesianChart.HorizontalAxis>
</telerik:RadCartesianChart>

I'm setting the colour of each individual Bar in the BarSeries via an IValueConverter (blue for positive, red for negative) using a BrushCollection defined in the UserControl's resources passed into the Value Converted.
It works very nicely!
The Chart is bount to an ObservableCollection<t> of items implemention INotofyPropertyChanged. When the values change, the graph does indeed update - but it never calls the Color Converter and it the value goes from - to + or the other way around it ends up with the wrong colour.

I can't see how to force this update. Is there a way?

Thanks -



svs
Top achievements
Rank 1
 answered on 23 May 2013
6 answers
675 views
Hello Telerik,


How could I make the resizing of the diagram shapes keep the aspect ratio?

Thanks in advance,
Metanous
Davide
Top achievements
Rank 1
 answered on 23 May 2013
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?