Telerik Forums
UI for WPF Forum
1 answer
224 views

How do I go about animating multiple series using utils:ChartAnimationUtilities.CartesianAnimation="Rise"? Below is my code, I have tried multiple ways and none work. Thanks.

 

 

<telerik:ChartSeriesProvider  Source="{Binding Data, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ParameterTraceControl}}}">             
                    <telerik:ChartSeriesProvider.SeriesDescriptors>
                        
                        <telerik:CategoricalSeriesDescriptor CategoryPath="ReadTime" 
                                                        ValuePath="Value" 
                                                        ItemsSourcePath="Items">
                            
                            <telerik:CategoricalSeriesDescriptor.Style>
                                <Style TargetType="telerik:LineSeries" BasedOn="{StaticResource LineSeriesStyle}">
                                    <Setter Property="StrokeThickness" Value="{Binding SelectedStrokeThickness, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" />
                                    <Setter Property="LegendSettings">
                                        <Setter.Value>
                                            <telerik:SeriesLegendSettings Title="{Binding SeriesName}" />
                                        </Setter.Value>
                                    </Setter>
                                  
                                </Style>
                            </telerik:CategoricalSeriesDescriptor.Style>
                            
                        </telerik:CategoricalSeriesDescriptor>
                        
                    </telerik:ChartSeriesProvider.SeriesDescriptors>
                    
                </telerik:ChartSeriesProvider>

Dinko | Tech Support Engineer
Telerik team
 answered on 05 Aug 2020
4 answers
444 views
Hello,

I'm a noob to WPF. I inherited an MVVM WPF project using Caliburn.Micro.

I have this gridview:
<telerik:RadGridView Margin="10"
                                         CanUserFreezeColumns="False"
                                         MaxHeight="300"
                             RowIndicatorVisibility="Collapsed"
                             IsReadOnly="False"
                             ScrollMode="Deferred"
                             BeginningEdit="RadGridView_BeginningEdit"
                             CellEditEnded="RadGridView_CellEditEnded"
                             ScrollViewer.PanningMode="VerticalFirst"
                             ScrollViewer.HorizontalScrollBarVisibility="Visible"
                             ItemsSource="{Binding SelectedCollectionPatient.CollectionTests}"
                             SelectedItem="{Binding SelectedCollectionTest}"
                             AutoGenerateColumns="False"
                             IsFilteringAllowed="False"
                             ShowGroupPanel="False"
                                         >
 
                        <telerik:RadGridView.Columns>
                                                         
                            <telerik:GridViewComboBoxColumn ItemsSource="{Binding Path=DataContext.SelectedCollectionPatient.CurrentStatusList,
                                                RelativeSource={RelativeSource FindAncestor,
                                                AncestorType={x:Type Window}}}"
                                                Width="145" IsReadOnly="False"
                                                DataMemberBinding="{Binding CurrentStatus}"
                                                Header="Collection Status"
                                                UniqueName="CurrentStatus" >
                            </telerik:GridViewComboBoxColumn>
                             
                            <telerik:GridViewDataColumn Width="*" IsReadOnly="False"
                                            DataMemberBinding="{Binding CollectionTime, StringFormat='{}{0:hh:mm tt}' }">
                                <telerik:GridViewDataColumn.CellEditTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            
                                            <telerik:RadMaskedDateTimeInput Margin="0"
                                                                     telerik:TouchManager.IsTouchHitTestVisible="False"
                                                                     EmptyContent="No Time Entered"
                                                                     VerticalContentAlignment="Center"
                                                                     Height="50" Width="150" Mask="hh:mm tt"
                                                                     Value="{Binding CollectionTime, UpdateSourceTrigger=PropertyChanged}">
                                            </telerik:RadMaskedDateTimeInput>
 
                                            <telerik:RadButton Command="{Binding RelativeSource={RelativeSource FindAncestor,
                                                            AncestorType={x:Type Window}},
                                                            Path=DataContext.SetCurrentTimeCommand}" Width="35" Margin="0">
                                                <Image Source="/HomeCollections.UI;component/Images/Icons/time.png" Width="16" Stretch="None"></Image>
                                            </telerik:RadButton>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellEditTemplate>
                            </telerik:GridViewDataColumn>
 
                            <telerik:GridViewComboBoxColumn ItemsSource="{Binding SelectedCollectionPatient.ReasonList}"                                                         
                                                Width="165" IsReadOnly="False"
                                                DisplayMemberPath="ReasonText"
                                                SelectedValueMemberPath="UncollectedReasonId"
                                                DataMemberBinding="{Binding UncollectedReasonId}"
                                                Header="Uncollected Reason">
                            </telerik:GridViewComboBoxColumn>
 
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>

When the CurrentStatus combo box column is changed, I want to check the status and:
1) update or clear the CollectionTime  (the masked input)
2) update or clear the UncollectedReason column

I'm current trying to do it in the RadGridView_CellEditEnded event... but haven't been able to figure it out.
if (e.Cell.Column.UniqueName == "CurrentStatus")
            {
                if (e.NewData != e.OldData)
                {
}
}


Thanks.

Vladimir Stoyanov
Telerik team
 answered on 04 Aug 2020
12 answers
1.4K+ views
Hi ,



Using RadPdfViewer (Q2 Release) in our project to show PDF documents / Reports for viewing and printing purposes.

There is a requirement to print the PDF file without showing the document and the Print Dialog, could we achieve printing of PDF document through RadPdfViewer control by setting the Visibility to Hidden mode and execute Print Command.

What settings are to be used for Printing silently through RadPdfViewer (without a Print Dialog).



Are there any other functions / Rad Controls to print a PDF document



Regards,

Phani.















Dimitar
Telerik team
 answered on 04 Aug 2020
1 answer
130 views

Hello,

 

When user enter a text in TrackChange mode, text divides by minutes. For example, if user begin write "This is a" at 16:09, and completes write " test for Telerik" at 16:10, Track Change detects it as 2 changes made in 16:09 and 16:10. Is it a feature, or is it a bug? :)

 

Is it possible to register a change when user completes write a text, at least on FocusLost action. Or may be other solution? I want to view "This is a test for Telerik" as one change, made in 16:10.

 

Thank you.

Dimitar
Telerik team
 answered on 04 Aug 2020
5 answers
352 views

Hi,

please can you advice me how to achieve range selection in RadCartesianChart which has dynamic number of series?
For chart itself I used ChartSeriesProvider as descripted in your tutorial but now I stuck with range selection.

Many thanks!

Minita
Top achievements
Rank 1
Veteran
 answered on 04 Aug 2020
5 answers
249 views
We are cloning a dialog to be very similar to the Cell Styles dialog in excel and one of the things we need to do is to put a gradient style ( ie. 50% gray, crosshatch, etc ) on a RadMenuItem. Each of our cells is a RadMenuItem. Do you have any samples where something like this was accomplished?
Vladimir Stoyanov
Telerik team
 answered on 03 Aug 2020
1 answer
677 views

I have a RadCartesianChart that I am dynamically adding linear series to. I set the minimum and maximum for the y-axis but sometimes it doesn't show a tick for the maximum value at the top of the y-axis. How can I get the graph to always display a tick for the maximum value?

Thanks

Martin Ivanov
Telerik team
 answered on 31 Jul 2020
1 answer
120 views

<br>    RecurrenceTask[] RecurrenceTask_Array = new RecurrenceTask[3];
            for (int i = 0; i < RecurrenceTask_Array.Length; i++)
            {
                RecurrenceTask_Array[i] = new RecurrenceTask(today.AddYears(11), today.AddHours(1), "Recurrence Series" + i.ToString())
                {
                    Recurrences = { recurrenceTask1, recurrenceTask2, recurrenceTask3 }
                };
            }
            for (int i = 0; i < RecurrenceTask_Array.Length; i++)
            {
                gts[0].Children.Add(RecurrenceTask_Array[i]);
                gts[1].Children.Add(RecurrenceTask_Array[i]);
            }
            for (int i = 0; i < gts.Length; i++)
            {
                this.Tasks.Add(gts[i]);
            }

this source occur argumentException
can i use RecurrenceTask in array?

 


Vladimir Stoyanov
Telerik team
 answered on 31 Jul 2020
11 answers
114 views

Hello,

I've based my code on the RecurringTask example project.
I was able to get my desired visual result but I've now discovered an action that causes my application to crash.
This makes it pretty much unusable, so I need to find a solution or at least a way to catch the exception and prevent it from crashing.

I've been able to pinpoint the cause of my problem, but have been unable to solve this by myself.

Let me start by describing my current situation/environment.

In the RecurringTask_WPF example project if you collapse the "Recurrence Series" (the parent tree node) then you can see all the child recurring tasks next to each other.
When you click on one of the events, so for example: "Recurrence 1"  block (in the TimeRuler Part of the RadGanttView), then this specific recurring task gets selected. This causes the tree node to be expanded automatically and the selected task/event becomes highlighted.

This behaviour works perfectly as intended and I wish to keep it like that exactly.
However once you nest recurring tasks into one extra level of hierarchy, which is on my requirements, an exception is thrown and the program stops working.

First I'll give you the code that changes the example project in order to recreate the problem. (This should also help with explaining the exact problem)
You should replace the GetTasks() method of the ViewModel.cs with the code below:

private ObservableCollection<IGanttTask> GetTasks()
{
    var collection = new ObservableCollection<IGanttTask>();
    var today = DateTime.Today.AddHours(8);
    var child1 = new RecurrenceTask(today, today.AddHours(4), "Reccurence 1");
    var child2 = new RecurrenceTask(today.AddHours(0), today.AddHours(12), "Reccurence 2");
    var child3 = new RecurrenceTask(today.AddHours(13), today.AddHours(20), "Reccurence 3");
    var task2 = new RecurrenceTask(today.AddHours(13), today.AddHours(20), "Recurrence Series2")
        {
            Children = { child3 }
        };
    var task1 = new RecurrenceTask(today, today.AddHours(20), "Recurrence Series1")
    {
        Children = { child1, child2, task2 }
    };
    collection.Add(task1);
    var taskWithoutRecurrence = new GanttTask(today.AddHours(8), today.AddHours(13), "Task Without Recurrence");
    taskWithoutRecurrence.Children.Add(new GanttTask(today.AddHours(9), today.AddHours(12), "Child Task"));
    collection.Add(taskWithoutRecurrence);
    return collection;
}

 

When you run the example with these code changes, you should see that the "Recurrence 3" task now is moved into a new "Recurrence Series2".
This new series is also a child of the original "Recurrence Series1".
So when then all the nodes become collapsed you can still see all child recurrences next to each other.
If you now click on the "Recurrence 3" event (in the TimeRuler Part of the RadGanttView) the application will throw a System.NullReferenceException.

This is the StackTrace  (it is in Dutch, but I believe it should still be readable):

   bij System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
bij System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
bij Telerik.Windows.Rendering.VirtualizedGridPanel.Handler.SetArrangeRect(Int32 column, Int32 row, Rect rect)
bij Telerik.Windows.Rendering.Internal.GridRenderingHelper.MeasureItemsCore(Rect viewport, IGridContainersHandler handler)
bij Telerik.Windows.Rendering.Internal.GridRenderingHelper.MeasureItems(Rect viewport, IGridContainersHandler handler)
bij Telerik.Windows.Rendering.VirtualizedGridPanel.MeasureContainers(IContainerRecycler recycler, Size availableSize)
bij Telerik.Windows.Rendering.Virtualization.VirtualizedPanel.MeasureOverrideCore(Size availableSize)
bij Telerik.Windows.Rendering.ScrollablePanel.MeasureOverride(Size availableSize)
bij System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bij System.Windows.UIElement.Measure(Size availableSize)
bij Telerik.Windows.Controls.GanttPresenterPanel.MeasureContainer(UIElement container, Size measureSize)
bij Telerik.Windows.Controls.GanttPresenterPanel.MeasureOverride(Size availableSize)
bij System.Windows.FrameworkElement.MeasureCore(Size availableSize)

 

Here are some other observations that might help you find the exact cause of this problem:

  • If you were to click any other recurring task then the program would keep working as expected.
  • If only the top note is collapsed and the child "Recurrence Series2" stays expanded, then the behaviour also keeps working as expected

It would seem that the problem only occurs when nested nodes are collapsed and a child task of a hierarchy that is at least 2 levels deep gets selected.

Now I would just like to find a way to stop my program from crashing.
I've tried handling click events in order to prevent the user from clicking on events in the TimeRuler Part of the RadGanttView, but I wasn't able to figure out how to and I would also still like to keep the behaviour of the automatic expanding and selecting the specific task.

I've also tried to implement a click-command which showed me that the expanding actually works correctly and the exception only occurs afterwards.

Any help would be very much appreciated.

 

 

 

 

Martin Ivanov
Telerik team
 answered on 31 Jul 2020
5 answers
516 views

Hello,

I trying to move rows up or down depending on user selection from the Context Menu.

And for some reason (still trying to figure out), the IndexOf is returning -1.

Below are my XAML code =>

             <telerik:RadGridView x:Name="gridView1" Grid.Row ="1" AutoGenerateColumns="False" Margin="0,5,0,10" FontSize="12" Deleted="OnDeletedIO"

                                                               Deleting="OnDeletingIO" telerik:StyleManager.Theme="Summer" DataGridCell.GotFocus="DataGrid_CellGotFocus">    
                        <telerik:RadGridView.ContextMenu>
                            <ContextMenu >
                                <MenuItem Header="MoveUp"  Click="MoveUp_click"/>
                            </ContextMenu>
                        </telerik:RadGridView.ContextMenu>
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding name}" Header="Name" IsReadOnly="False"/>
                            <telerik:GridViewComboBoxColumn x:Name="ComboGroup" DataMemberBinding="{Binding group}"  Header="Group"/>
                            <telerik:GridViewComboBoxColumn x:Name="ComboRTU" DataMemberBinding="{Binding rtu}"  Header="RTUs"/>
                            <telerik:GridViewComboBoxColumn x:Name="ComboOP" DataMemberBinding="{Binding op}"  Header="Operation"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding addr}" Header="Address"/>
                            <telerik:GridViewComboBoxColumn x:Name="ComboTypes2" DataMemberBinding="{Binding dataType}"  Header="Data Type"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding swapByte}" Header="Byte&#x0a;Swapping"
                            IsReadOnly="True">                                
                           </telerik:GridViewDataColumn>
                        </telerik:RadGridView.Columns>
                  </telerik:RadGridView>

 

C# code =>

namespace MBM_WPF
{    
    public partial class MainWindow : Window
    {

        MBM mbm1 ;
        MBM_view mbmView;        
 
        public MainWindow(string path)
        {
            StyleManager.ApplicationTheme = new SummerTheme();
            InitializeComponent();
            logger = LogManager.GetLogger("Instruct.MBM_Main");
            Configpath = path;
            
            //Populating ItemsSource here
            
            catch 
            {
                mbm1 = new MBM();
                mbmView = new MBM_view(mbm1, OnSettingChanged);
                BindMyData();
            }
        }

private void MoveUp_click(object sender, RoutedEventArgs e)
        {            
            //Get the clicked MenuItem
            var menuItem = (MenuItem)sender;
            
            //Get the ContextMenu to which the menuItem belongs
            var contextMenu = (ContextMenu)menuItem.Parent;            

            //Find the placementTarget
            var item = (RadGridView)contextMenu.PlacementTarget;
            
            int index = this.gridView1.Items.IndexOf(item.SelectedItem);

            this.gridView1.Items.Remove(item.SelectedItem);
           
            this.gridView1.Items.Insert(index - 1, item.SelectedItem);
            item.SelectedItem = item; 

            mbmView.IoListCleanUp();
            mbmView.AlarmsCleanUp();    

        }
     }
}

Please help.

Thank you!!

 

Regards,

Darren

 

Martin Ivanov
Telerik team
 answered on 31 Jul 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
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?