Telerik Forums
UI for WPF Forum
1 answer
65 views
Hello! 

Symptoms: RadDataForm don not see custom properties of object which implements ICustomTypeDescriptor when RadDataForm.CurrentItem set and RadDataForm.ItemsSource is null.

Location ItemPropertyInfoHelper.cs(Telerik.Windows.Data.dll assembly Telerik.Windows.Data namespace):
private static PropertyDescriptorCollection GetPropertyDescriptors(QueryableCollectionView collectionView)
{
...
if (TypeExtensions.IsCompatibleWith(elementType, typeof (ICustomTypeDescriptor))) //code pass
        return ItemPropertyInfoHelper.GetPropertyDescriptorsForCustomTypeDescriptorElementType(collectionView);
...
}
 
public static PropertyDescriptorCollection GetPropertyDescriptorsForCustomTypeDescriptorElementType(QueryableCollectionView collectionView)
    {
      var customTypeDescriptor = ItemPropertyInfoHelper.GetCollectionViewRepresentativeItem(collectionView) as ICustomTypeDescriptor; //returns null
      if (customTypeDescriptor != null) return customTypeDescriptor.GetProperties(); //Never called when ItemsSource is not set
      else return null;
    }
 
private static object GetCollectionViewRepresentativeItem(QueryableCollectionView collectionView)
    {
      if (!collectionView.IsEmpty) return collectionView.GetItemAt(0); //collection is empty
      else return null;
    }

Can you confirm this behavior?
Telerik version 2013.3.1016.40

Maya
Telerik team
 answered on 12 May 2014
1 answer
545 views
I have a usercontrol that has a Listbox of Listboxes.   That usercontrol is put inside a Scrollviewer.   I have made a sample application I have attached a link to.  My real version uses MVVM, so please keep that in mind.   What I am trying to accomplish is if a new item is added to the listboxes in the Usercontrol, how can I make the Scrollviewer on the MainWindow scroll to where the new item was just added add the end of whatever listbox it was added?

https://www.dropbox.com/s/dia9ri3h63ne4aq/ListScrollExample.zip

Kalin
Telerik team
 answered on 12 May 2014
3 answers
528 views
Hi.
I have a main window with several RadGridViews and InputBindings set up on the main Window to fire Commands of my ViewModel class. Works fine, as long as the focus is not within a RadGridView. When focus is within a RadGridView, the commands are not triggered. If I repeat the keybindings for each RadGridView e.g add:

<telerik:RadGridView.InputBindings>
<KeyBinding Key="A" Modifiers="Ctrl" Command="{Binding MyCommand}" />
</telerik:RadGridView.InputBindings>

to each of my gridview XAML blocks, then the commands will be triggered correctly. But I would like to avoid having to repeat the bindings (there will be many).

How can I avoid the RadGridView capturing these keystrokes?

(I've tried this post, but that doesn't work with key modifiers, since it fires as soon as CTRL is pressed).
Silviu
Top achievements
Rank 1
 answered on 12 May 2014
14 answers
241 views
Hi,

with a vertical orientation, I would like to know how I can implement a vertical AND a horizontal zoom???

Thank's
Alain
Rosi
Telerik team
 answered on 12 May 2014
3 answers
180 views
HI,

I want to change default image and show text in "Paint with MVVM" Sample.
Please, show attach file.

Thank you.
Kiril Vandov
Telerik team
 answered on 12 May 2014
3 answers
120 views
When binding a RadMenuItem to a command, the command's Key-Gesture (Like "Ctrl-C" for the Copy command) appears on the right side.

Unfortunately these hints for key gestures are not aligned nicely on the right side, like in normal MenuItem, but their position depends on length of the command text (header). This look really ugly! (see attached picture)

There are several posts stemming from 2010-12 where other users have similar problems. 

Do you have fixed it finally in 2014??? 

... I really hope so, because a commercial control should not be worse than the framework.
Rosen Vladimirov
Telerik team
 answered on 12 May 2014
1 answer
167 views
My code is below that

public class MultiVerticalAxisConverter : IMultiValueConverter
{
   NumericalAxis verticalAxis = null;
   LinearAxis axis = new LinearAxis();

   ....

   //axis.PanZoomBarStyle
   // About SelectedStart & End Setting

   verticalAxis = axis;

   return verticalAxis;
}

I want to set when created verticalAxis.

Such as below .xaml code.

                        <Style TargetType="telerik:PanZoomBar">
                            <Setter Property="SelectionStart" Value="{Binding Ribbon.ZoomData, Mode=TwoWay}"/>
                            <Setter Property="SelectionEnd" Value="{Binding .Ribbon.ZoomData, Mode=TwoWay}"/>
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </Style>

What should I do?
Pavel R. Pavlov
Telerik team
 answered on 12 May 2014
9 answers
741 views


Hi Team, I am relatively new in the Telerik WPF control world.
I am starting a new project where we have decided to use RadDocking. There will be a main DocumentHost to host my main window. It is very similar to Visual Studio type experience where I need to dynamically open multiple tabs in the DocumentHost. Besides, there will be a few dockable RadSplitContainer to host RadPanes. There will be interactions between these different panes.

Given that RadDocking is part of the application main window and different panes are like child to it, how do I make the app fully modular with MVVM pattern? I of course do not want a giant ViewModel that is the datacontext of the entire RadDocking.

I rather create UserControl specific to each child pane and have separate ViewModel for each UserControl.

Do not want any code in the code behind. What are your recommendations and best practices?

Vladi
Telerik team
 answered on 12 May 2014
1 answer
684 views
 I am running into a selection issue with WPF GridView.   I need the Grid to work just like Windows Explorer as far as using a Context Menu on right click.  Meaning if the user right clicks an item or range of items, the context menu will open and those items will be selected.  What is throwing me if that if I try to put in code to right click/select, I can't get the other items like multiple select using CTRL or SHIFT to work correctly.  So just like Windows Explorer, the rules on selecting would be:

1) User can right click and select an item without left clicking to select first.
2) User can hold down SHIFT and select a range of items then right click/context menu on selected items.
3) User can hold down CTRL and select individual items then right click/context menu on those selected items.

This is what I have tried but it doesn't work if I am using CTRL, selecting items, then right clicking to get Context Menu.  So do you have any suggestions or samples to make it work EXACTLY like Windows Exploring for selecting items?

 private void GroupGrid_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {

            var s = e.OriginalSource as FrameworkElement;
            var parentRow = s.ParentOfType<GridViewRow>();
            var rowItem = parentRow as GridViewRowItem;
            var mediaItem = rowItem as RadRowItem;
            if (gridAdvancedSearch.SelectedItems.Count > 1 && gridAdvancedSearch.SelectedItems.Contains(mediaItem.Item))
            {
                e.Handled = true;
            }
            else
            {
                gridAdvancedSearch.SelectedItems.Clear();

                if (parentRow != null)
                    parentRow.IsSelected = true;
            }

        }

Dimitrina
Telerik team
 answered on 12 May 2014
5 answers
337 views
I'm using a RadTimeBar that only displays 24 hours of data at a time. Below is a sample application to reproduce the issue I'm having:

namespace TimelineTest
{
    public partial class MainWindow : Window
    {
        private List<Item> items = new List<Item>();
        public MainWindow()
        {
            InitializeComponent();
             
            items.Add(new Item() { Date = new DateTime(2014, 5, 5), Duration = TimeSpan.FromHours(5) });
            items.Add(new Item() { Date = new DateTime(2014, 5, 5, 14, 18, 22), Duration = TimeSpan.FromHours(5) });
 
            timeline.ItemsSource = items;
        }
 
        public class Item
        {
            public TimeSpan Duration { get; set; }
            public DateTime Date { get; set; }
        }
 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DateTime now = DateTime.Now;
            timebar.PeriodStart = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0);
            timebar.PeriodEnd = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59);
        }
    }
}

And the XAML:

<Window x:Class="TimelineTest.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadTimeBar Name="timebar" Height="64" Margin="10,0,10,193" PeriodStart="5/5/2014 00:00:00" PeriodEnd="05/5/2014 23:59:59" VerticalAlignment="Bottom" MaxSelectionRange="0:0:10" MinSelectionRange="0:0:10" SelectionTitleFormatString="{}{0:MM-dd-yy  HH:mm:ss}">
            <telerik:RadTimeBar.Intervals>
                <telerik:HourInterval IntervalSpans="1,4"/>
                <telerik:MinuteInterval IntervalSpans="1,5,15,30"/>
            </telerik:RadTimeBar.Intervals>
            <telerik:RadTimeBar.Content>
                <telerik:RadTimeline Name="timeline" Margin="0, -65, 0, 0" PeriodStart="{Binding PeriodStart, ElementName=timebar}" PeriodEnd="{Binding PeriodEnd, ElementName=timebar}" telerik:StyleManager.Theme="Windows8Touch" StartPath="Date" DurationPath="Duration" ScrollMode="None">
                    <telerik:RadTimeline.Intervals>
                        <telerik:DayInterval IntervalSpans="1"/>
                    </telerik:RadTimeline.Intervals>
                </telerik:RadTimeline>
            </telerik:RadTimeBar.Content>
        </telerik:RadTimeBar>
        <Button Content="Button" HorizontalAlignment="Left" Margin="125,230,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
    </Grid>
</Window>


On the initial load, all works fine. In the scroller at the bottom, you can re-size the selection as normal (dragging on each size of the scroll bar), and it won't let you zoom too far in.

But I have to be able to change the period on the fly. I have a datePicker that allows the user to change the date for the data in the timebar. So I need to change the 'PeriodStart' and 'PeriodEnd' from code-behind. In the example above, I just hard-coded it in a button click. After I do this, it seems as if you can zoom in infinitely and the application eventually crashes with an overflow exception "Arithmetic operation resulted in an overflow". Sometimes, it throws the exception immediately after zooming in too far. Sometimes you have to drag/zoom in and out a few times.

Is there another way to change 'PeriodStart' and 'PeriodEnd' after it is initially loaded? Or is there a way to 're-initialize' the control after changing the period properties, so that you can't zoom in infinitely?
Brian
Top achievements
Rank 1
 answered on 10 May 2014
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
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
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?