Telerik Forums
UI for WPF Forum
6 answers
972 views
Hi,

I have a ViewModel with a collection binded to my user control, and then one of the ViewModel properties is binded to a RadTreeView. I need to support multiple selection, but it seems I can't bind SelectedItems property. Any tips on how to achieve this?

Regards
Pavel R. Pavlov
Telerik team
 answered on 22 Apr 2015
1 answer
136 views

I have a RadTreeView with some Containers and some Items (the items do not contain other items). When I activate Drag and Drop everything works fine. My problem is that I have some Containers that should not work as drop target. Unfortunatly I could not find an example.

First I tried the property IsDroppingAllowed (I used it like IsExpanded and IsSelected). Unfortunatly the getter is never called.

Than I tried "OnDragOver"

DragDropManager.AddDragOverHandler(this.FolderRadTreeView, new Telerik.Windows.DragDrop.DragEventHandler(OnDragOver), true);

It seems that I have to set 
options.DropAction = DropAction.Move;

or

options.DropAction = DropAction.None;

and everything works fine. But after a while it drives me crazy. Is there anywhere a good example? Is there anywhere a checklist what I have to reimplement? 

I tried to use the DropTargetItem to check if the dropping is allowed.

var options = DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key) as TreeViewDragDropOptions;
var dropItem = options.DropTargetItem.Item;
(dropItem as IFolderItem).IsDroppable(options.DraggedItems));

If I drop inside everthing is fine. If I drop before (Telerik.Windows.Controls.DropPosition.
Before) it seems that my dropItem I used for IsDroppable() is not the container where the RadTreeView drops my item. 

An other trapdoor it that I have to check that I do not drag an Item in itself (drag A and drop it in A or drop in a child of A).

Martin Ivanov
Telerik team
 answered on 22 Apr 2015
4 answers
113 views

Hi team,

I am using custom Connectors and Connections along with MVVM. Per the thread, I can add some custom connection points in the overridden method GetConnectionContainerForItemOverride

protected override IConnection GetConnectionContainerForItemOverride(object item)
{
    if (item is Link)
    {
        ...

                return a custom connection object;

    }
 
    return null;
}

Meanwhile I want to attach the connection to my custom connectors inside this method. However, at this time, the connectors of the shape still are the 5 default connectors. Are there any means to control the sequence of the overwritten methods? Or I should overwrite another virtual method? 

Thanks,

Jingfei

Jackey
Top achievements
Rank 1
 answered on 22 Apr 2015
5 answers
267 views

There is a bug in RadListBox when using GroupStyle. When I select any an item from second group, radlistbox scrolls to first item in second group. This makes double click on an items almost imposible.

I wrote a simple sample demonstrating the behaviour with comparison to regular listbox

<Window x:Class="RadControlsWpfApp2.MainWindow"
  xmlns:local="clr-namespace:RadControlsWpfApp2"
  Title="MainWindow" Height="350" Width="525">
  <Window.DataContext>
    <local:MainWindowVM />
  </Window.DataContext>
  <Grid>
 
    <StackPanel Orientation="Horizontal">
      <ListBox x:Name="listbox" ItemsSource="{Binding CollectionView}" IsSynchronizedWithCurrentItem="False" DisplayMemberPath="Name" FontSize="20" MinWidth="150">
        <ListBox.GroupStyle>
          <GroupStyle  />
        </ListBox.GroupStyle>
      </ListBox>
 
 
 
      <telerik:RadListBox x:Name="radlistbox" ItemsSource="{Binding CollectionView}"  DisplayMemberPath="Name" FontSize="20" MinWidth="150" Margin="20,0,0,0">
        <telerik:RadListBox.GroupStyle>
          <GroupStyle  />
        </telerik:RadListBox.GroupStyle>
      </telerik:RadListBox>
    </StackPanel>
  </Grid>
</Window>

using System.Collections.Generic;
using System.Windows.Data;
 
namespace RadControlsWpfApp2
{
  public class MainWindowVM
  {
    public List<ItemVM> Collection { get; set; }
 
    public ListCollectionView CollectionView    {      get;      set;    }
 
    public MainWindowVM()
    {
      Collection = new List<ItemVM>
      {
        new ItemVM { Group = "A", Name = "Item 1" },
        new ItemVM { Group = "A", Name = "Item 2" },
        new ItemVM { Group = "A", Name = "Item 3" },
        new ItemVM { Group = "A", Name = "Item 4" },
        new ItemVM { Group = "A", Name = "Item 5" },
        new ItemVM { Group = "A", Name = "Item 6" },
        new ItemVM { Group = "B", Name = "Item 1" },
        new ItemVM { Group = "B", Name = "Item 2" },
        new ItemVM { Group = "B", Name = "Item 3" },
        new ItemVM { Group = "B", Name = "Click Here!" },
        new ItemVM { Group = "B", Name = "Item 5" },
        new ItemVM { Group = "B", Name = "Item 6" },
      };
 
      var view = new ListCollectionView(Collection);
      view.GroupDescriptions.Add(new PropertyGroupDescription("Group"));
      CollectionView = view;
    }
 
 
  }
 
  public class ItemVM
  {
    public string Group { get; set; }
    public string Name { get; set; }
  }
}


Nasko
Telerik team
 answered on 21 Apr 2015
8 answers
253 views
Hi Team - Is it possible to have paging or load on demand feature with RadAutoCompleteBox control? I have thousands of records to show in an autocompletebox which takes a lot of time to load.
Vitalij
Top achievements
Rank 1
 answered on 21 Apr 2015
6 answers
363 views

Hello,

I have a custom control which inherits from usercontrol. My control is the itemtemplate of a radtreeview.

<telerik:RadTreeView.ItemTemplate>

    <HierarchicalDataTemplate ItemsSource="{Binding MyList}">

         <MyControls:MyTreeNode AllowDrop="{Binding IsDropAllowed}"/>

    </HierarchicalDataTemplate>

</telerik:RadTreeView.ItemTemplate>

 

I want to bind the AllowDrop Property from my control (MyTreeNode). When AllowDrop is false, it should not possible to drop other nodes on this node. But this doesn’t work. The radtreeview ignores the allocation. Is there any way that my control has the same behavior likes a radtreeviewitem, when the IsDropAllowed Property is false.


With best regards,
Sico

Petar Mladenov
Telerik team
 answered on 21 Apr 2015
2 answers
126 views
Hello,

  When RibbonWindow set MinWidth or MinHeight,
  if width or height to be smaller than MinWidth or MinHeight,
  it's clipping the window, but previous version is ok.

  The simple example :

  <Grid>
      <Button VerticalAlignment="Center" Height="100" Background="Yellow">Test</Button>
  </Grid>

  public partial class MainWindow : RadRibbonWindow
  {
      public MainWindow()
      {
          InitializeComponent();

          this.MinWidth = 500;
      }
  }

  2015 Q1 is OK
  2015 Q1 Hotfix 0316 is OK
  2015 Q1 Hotfix 0323 is clip
  2015 Q1 SP1 is clip
  2015 Q1 SP1 Hotfix 0406 is clip
  2015 Q1 SP1 Hotfix 0413 is clip

  How can I fix this ? Thanks.

Regards

Chang
Top achievements
Rank 1
 answered on 21 Apr 2015
5 answers
189 views

Hi, I want the time bar to show hours in European format (e.g 23 and not 11 PM).

The only way I found to achieve this is to set the global Telerik.Windows.Controls.LocalizationManager.DefaultCulture.

  1. 1. I tried to set Telerik.Windows.Controls.LocalizationManager.DefaultCulture to "de-DE". It removes AM/PM but does not change the number. So the range I get is 1-12 and not 0-23
  2. In our application we use a custom culture info, something like this
    cultureInfo = new CultureInfo("en-US");
    cultureInfo.NumberFormat = ...
    cultureInfo.DateTimeFormat.ShortDatePattern = ...

    What part of the cultureInfo is used to determine how hours are shown in time bar?
  3. I have similar issue with datetimepicker. How can i modify our culture info such that is uses 0-23 for hours instead of AM/PM (I see it has a property culture, so here I can just set "de-DE" as a workaround without effecting rest of application)
Milena
Telerik team
 answered on 21 Apr 2015
3 answers
133 views

Hi,

 

I've noticed when adding plot points that they're not being placed accurately? The data point in the attached image should be plotted at 0,0 so the lines should intersect the circular data point evenly. However it plots it off centre.

 

Do I have a setting wrong or something?

 

Thanks,

Petar Marchev
Telerik team
 answered on 21 Apr 2015
5 answers
260 views

In my project, I have a timeline that is updated every second or so.

At each second, an Item with a duration representing the elapsed time is updated : its duration is modified.

 

 When only the duration of one item changes, the timeline is redrawn when the VisibleStartDate and/or VisibleEndDate are changed.

If the visible zone is not changed, the only way to make the new duration of the item appear on the timeline is to use the Setter on ItemsSource.  But this results in poor performances, most notably because I have implemented a mechanism that remembers the selected items when the Data is refreshed (it reselects it).

 

So in order to only redraw the timeline without having to update the ItemSource, I resolved to this uglyhack (that works, though).

In the view model.

public void UpdateItemDurationAndRefresh()
{
    itemWithDuration.Duration = GetNewTimeSpan();
    this.VisibleDate = this.VisibleDate.AddMilliseconds(-1);
    this.VisibleDate = this.VisibleDate.AddMilliseconds(1);
}

 I tried the following, but the duration of the item is not visible until some other interactions either changes the visible zone, or the ItemSource is actually updated.

public void UpdateItemDurationAndRefresh() // DOES NOT WORK
{
    itemWithDuration.Duration = GetNewTimeSpan();
    this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs("Data"));
   // "Data" is the name of the collection containing "itemWithDuration",
   // and is binded to the GUI thanks to the XAML code
}

 

 

Is there anyway to redraw the timeline without having to reset the ItemSource, just like what is done when the visible zone is modified ?

 

Thanks

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