Telerik Forums
UI for WPF Forum
3 answers
107 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
152 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
680 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
636 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
316 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
1 answer
184 views
Hello

I have the following situation:

If the Scale factor is not set as auto, when you click on the canvas resize button, the factor goes to 1, showing the whole image.

You can try this using the demo Image Editor:

1. Open the Image Editor demo
2. Load a large image (1024x768?) 
3. Change the zoom from auto to any other value
4. Click on Canvas Resize 
Observe that the factor now is 1 (100%).

Now if you repeat the same instructions, it won't happen again.

Any ideas?












Missing User
 answered on 10 May 2014
1 answer
193 views
My code is below that

<chartView:CartesianChartGrid MajorLinesVisibility="{Binding Ribbon.AxisGrid, Converter={StaticResource axisConverter}}">
                
  <telerik:CartesianChartGrid.Style>
        <Style TargetType="telerik:CartesianChartGrid">
               <Setter Property="MajorXLineDashArray" 
                      Value="{Binding Ribbon.AxisGridLine, Converter={StaticResource axisConverter}}"/>
               <Setter Property="MajorYLineDashArray" 
                      Value="{Binding Ribbon.AxisGridLine, Converter={StaticResource axisConverter}}"/>
         </Style>
  </telerik:CartesianChartGrid.Style>

................

     <telerik:CategoricalSeriesDescriptor.Style>
            <Style TargetType="chartView:LineSeries">
                    <Setter Property="VerticalAxis" Value="{Binding Data, Converter={StaticResource additionalVerticalAxisConverter}}"/>
            </Style>
     </telerik:CategoricalSeriesDescriptor.Style>


I do setting 'MajorYLineDashArray & MajorLinesVisibility'.

But my program does not appear 'MajorLine'

What should I do?

Additionally, attached file

 

Pavel R. Pavlov
Telerik team
 answered on 10 May 2014
1 answer
56 views
good day,
bought lincença to utlização of some components of Telerik, first I'm going to use and add the RadGridView, but I have some difficulties and doubts.

1. FilteringMode = FilterRow
2. FilterOperator = StartsWith
. 3 Using wildcard expressions to filter every textbox to filter EXAMPLE: Like the SQL Server.

- Now I need to navigate between 'TextBox' filter using the Left and Right keyboard keys.
- Focus to 'Focus' in 'Grid' to "Down" keys, key but I have no idea how to do this.

graciously
André
Dimitrina
Telerik team
 answered on 09 May 2014
1 answer
218 views
I'm building a way to generate columns based on an IEnumerable inside a ViewModel bound to a single row. 
When creating a cell element, the DataContext of that element is set to something based on a property path.

Consider the following example:

class Order {
       public List<OrderLine> Lines { get; }
}
 
class OrderLine {
        public int Index { get; }
      public string Data { get; }
}
  • A GridViewRow would be bound to an Order object.
  • For each line in this example a column will be created.

To achieve this, I created a custom column:

public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
       // more code to create item etc.
       item.SetBinding(FrameworkElement.DataContextProperty,
           new Binding(DataMemberBindingPath) { Source = dataItem });
}

The DataMemberBindingPath contains something like Lines[0] or Lines[1]. This works fine since the WPF data binding engine can handle this. When I try to define the SortMemberPath containing an Indexer, nothing happens and the expression does not seem to be parsed.

Looking at the GridViewColumn source code, there is a method of interest:

internal virtual Expression CreateSortKeyExpression(ParameterExpression parameterExpression, ExpressionBuilderOptions options)
    {
        var builder = CreateBuilder(parameterExpression, this.EffectiveSortMemberType, this.EffectiveSortMemberPath, options);
 
        return builder.CreateMemberAccessExpression();
    }

However the method is Internal and I cannot override this to allow working with indexers.

Is there any workaround available to override the sort behavior for a custom column?

Dimitrina
Telerik team
 answered on 09 May 2014
4 answers
196 views
Dear customer support,
I am not sure if this is a bug or it is suppose to work by this way. Here is the code of whole RadRibbonView:
http://pastebin.com/eLKRbZba

And please see this video: https://www.youtube.com/watch?v=m_s0HSMgpK4&feature=youtu.be

First time when I run the project I open the code above in Window and as you see it works.
Then I change it to what I need. The structure is Windows with RadBusyIndicator + Frame where I navigate to Login Page. When user is login the frame navigate to the main program again it is Page. This is the exactly same code in pastebin. As you see when I click ApplicationButton the Backstage not open anymore.

This is a bug or it is suppose to not work in Page?

Best regards,
Saykor
Saykor
Top achievements
Rank 2
 answered on 09 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?