Telerik Forums
UI for WPF Forum
1 answer
109 views
Hi, after moving from Telerik 2013.3 to 2014.3 we get an exception when the popupmenuitems in a radribbongallery is about to expand. We are using the same control several places in our application and it only fails one place, so it takes some wizardry to make it fail. I am not able to reproduce this in a test exampleb but if you by chance have any suggestions on things to try it would be appreciated.

Here's a simpliefied xaml that fails:
            <telerik:RadRibbonGallery.PopupMenuItems>
                <telerik:RadMenu ClickToOpen="False">
                <telerik:RadMenuItem Header="Test">
                    <telerik:RadMenuItem Header="Test submenu"/>
                </telerik:RadMenuItem>
                </telerik:RadMenu>
            </telerik:RadRibbonGallery.PopupMenuItems>

Here's the exception details:

Exception1:
Cannot perform action because the specified Storyboard was not applied to this object
for interactive control.

System.Windows.Media.Animation.Storyboard

GetStoryboardClock

Source:
PresentationFramework


Target:
System.Windows.Media.Animation.Clock
GetStoryboardClock(System.Windows.DependencyObject, Boolean,
InteractiveOperation)

 

Stacktrace:   
at
System.Windows.Media.Animation.Storyboard.GetStoryboardClock(DependencyObject
o, Boolean throwIfNull, InteractiveOperation operation)

  
at System.Windows.Media.Animation.Storyboard.GetCurrentStateImpl(DependencyObject
containingObject)

  
at System.Windows.Media.Animation.Storyboard.GetCurrentState()

  
at
Telerik.Windows.Controls.Animation.AnimationManager.StopIfRunning(FrameworkElement
target, String animationName, Boolean animateSelf)

  
at Telerik.Windows.Controls.RadMenuItem.OnIsSubmenuOpenChanged(DependencyObject
d, DependencyPropertyChangedEventArgs e)

  
at
System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs
e)

  
at
System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs
e)

  
at
System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs
args)

  
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex,
DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry,
EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean
coerceWithCurrentValue, OperationType operationType)

  
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object
value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean
coerceWithCurrentValue, OperationType operationType, Boolean isInternal)

  
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object
value)

  
at Telerik.Windows.Controls.RadMenuItem.set_IsSubmenuOpen(Boolean value)

  
at Telerik.Windows.Controls.RadMenuItem.CloseMenu()

  
at Telerik.Windows.Controls.RadMenuItem.OnIsSelectedChanged(DependencyObject d,
DependencyPropertyChangedEventArgs e)

  
at
System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs
e)

  
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs
e)

  
at
System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs
args)

  
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex,
DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry,
EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean
coerceWithCurrentValue, OperationType operationType)

  
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object
value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean
coerceWithCurrentValue, OperationType operationType, Boolean isInternal)

  
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object
value)

  
at Telerik.Windows.Controls.RadMenuItem.set_IsSelected(Boolean value)

  
at Telerik.Windows.Controls.MenuBase.set_CurrentSelection(RadMenuItem value)

  
at Telerik.Windows.Controls.MenuBase.CloseAll()

  
at Telerik.Windows.Controls.RadMenuItem.OnCloseTimerTick(Object sender,
EventArgs e)

  
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)

  
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs)

  
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source,
Delegate method, Object args, Int32 numArgs, Delegate catchHandler)





Milena
Telerik team
 answered on 06 Jan 2015
2 answers
222 views
Is there any way to make the number scale within the gauge match the Outerborder of the gauge? It seems to be wider at the base of the gauge and if I want to add a GaugeRange it looks odd. thanks chuckl 

<telerik:RadSemicircleNorthGauge Width="182.5" Height="100" InnerBackground="white" OuterBackground="WhiteSmoke" OuterBorderThickness="0">
<telerik:SemicircleNorthScale ShowLastLabel="False" FontSize="11" VerticalAlignment="Center" Min="0" Max="99" RangeOffset="7" >
<telerik:SemicircleNorthScale.Indicators>
<telerik:Needle Value="65" />
<telerik:Pinpoint />
</telerik:SemicircleNorthScale.Indicators>
<telerik:SemicircleNorthScale.Ranges>
<telerik:GaugeRange Min="0" Max="65" Background="Green" />
<telerik:GaugeRange Min="65" Max="99" Background="Red"/>
</telerik:SemicircleNorthScale.Ranges>
</telerik:SemicircleNorthScale>
</telerik:RadSemicircleNorthGauge>

<telerik:RadSemicircleNorthGauge Width="182.5" Height="100" InnerBackground="WhiteSmoke"
OuterBackground="WhiteSmoke" Background="WhiteSmoke" BorderBrush="WhiteSmoke" OuterBorderThickness="1">
<telerik:SemicircleNorthScale FontSize="11" VerticalAlignment="Center" Min="0" Max="100" MajorTicks="10" MiddleTicks="1" >
<telerik:SemicircleNorthScale.Indicators>
<telerik:Needle Value="26" />
<telerik:Pinpoint />
</telerik:SemicircleNorthScale.Indicators>
</telerik:SemicircleNorthScale>
</telerik:RadSemicircleNorthGauge>
Martin Ivanov
Telerik team
 answered on 06 Jan 2015
1 answer
167 views
Hello,

When displaying scatter plots, I like to use the following three properties on my ScatterSeries:
ClipToBounds=False, ClipToPlotArea=False, and ZIndex=1000 
to ensure the points don't get clipped by the axes and boundary scrollbars.  See attached pic for the result, when using a single series.

I'm not quite sure how to set the ZIndex of the scatter series when using a ChartSeriesProvider though for dynamic series.  It lets me set the ClipToBounds and ClipToPlotArea properties, but not the ZIndex using attached properties.

<telerik:ChartSeriesProvider Source="{Binding MultiSeriesData}">
    <telerik:ChartSeriesProvider.SeriesDescriptors>
        <telerik:ScatterSeriesDescriptor ItemsSourcePath="Data" XValuePath="X" YValuePath="Y">
            <telerik:ScatterSeriesDescriptor.Style>
                <Style TargetType="telerik:ScatterPointSeries" BasedOn="{StaticResource ScatterPointSeriesStyle}">
                    <Setter Property="ClipToBounds" Value="False" />
                    <Setter Property="ClipToPlotArea" Value="False" />
            <!-- I'd like to be able to do the following, but it causes an error -->
            <!-- <Setter Property="ZIndex" Value="1000" /> -->
                </Style>
            </telerik:ScatterSeriesDescriptor.Style>
        </telerik:ScatterSeriesDescriptor>
    </telerik:ChartSeriesProvider.SeriesDescriptors>
</telerik:ChartSeriesProvider>

Any suggestion on how to set the ZIndex of the dynamic scatter series?  It doesn't matter to me if they're all the same value, they just need to be higher than the chart boundary scrollbars.
Petar Marchev
Telerik team
 answered on 06 Jan 2015
8 answers
123 views
Hi All,

I am using Telerik WPF trial version but my client will buy it soon. I am recursively loading directories tree and listing on RadTreeListView.

The top most directories trees are working but the most buttom doesn't work as expect.

Seet the attach files
Weera
Top achievements
Rank 1
 answered on 05 Jan 2015
3 answers
1.3K+ views
Hello, I want to change Combobox style ( for instance simple changes of borderbrush, see attached file please).
I tried to change some value of colors in templates, but there is no any result.

Could you explain me step-by-step how can I change borderbrush (of cause separate color when control is enabled and disabled)?
Thank You
Nasko
Telerik team
 answered on 05 Jan 2015
1 answer
116 views
I'm trying to add a behavior inside all cells of a column. 

  <telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate DataType="itemGrid:ItemGrid">
      <Grid Panel.ZIndex="10" Background="Red" VerticalAlignment="Stretch"      HorizontalAlignment="Stretch">
          <TextBlock Text="{Binding ItemName}"/>
           <i:Interaction.Behaviors>
             <behaviors:InertiaDeleteCptBehavior/>
           </i:Interaction.Behaviors>
        </Grid>
  </DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>

And to catch manipulation events like that : 

protected override void OnAttached() {
          base.OnAttached();
          AssociatedObject.ManipulationDelta += Item_ManipulationDelta;
          AssociatedObject.ManipulationInertiaStarting += Item_ManipulationInertiaStarting;
          AssociatedObject.ManipulationCompleted += Item_ManipulationCompleted;
      }

I thind that the GridView handle events an nothing past inside my behavior. Can i find another solution to work around this problem.
Nick
Telerik team
 answered on 05 Jan 2015
1 answer
139 views
Hi Guys, 

Sorry about bringing up a probably n00b question. 
I have a string which is in the format of a csv. I have parsed the csv and want to show the contents in a RadGridView. 
This is what I have done and a bit lost at the moment.

C#
//COnstructor accepting string
        public ucCsvEditor(string csv)
        {
            InitializeComponent();
            using (StringReader sr = new StringReader(csv))
            {
                var reader = new CsvReader(sr);
 
                //CSVReader will now read the whole file into an enumerable
                while (reader.Read())
                {
                    string[] records = reader.CurrentRecord;
                    string[] headers = reader.FieldHeaders;
                    variablesValue.Add(records);
                    variablesHeader.Add(headers);
                }
                //ObservableCollection<string[]> myCollection = new ObservableCollection<string[]>(variablesValue);
                radGridView.ItemsSource = variablesValue;
                //reader.FieldHeaders
            }
        }

XAML:
<Grid>
       <telerik:RadGridView x:Name="radGridView" Grid.Row="0" AutoGenerateColumns="True" IsReadOnly="False" CanUserDeleteRows="False" />
   </Grid>

I call this GridView from the following code:
C#
if (!string.IsNullOrEmpty(csvData))
            {
                RadWindow winCsvEditor = new RadWindow();
                ucCsvEditor temp = new ucCsvEditor(csvData);
                winCsvEditor.Content = temp;
                winCsvEditor.Header = "CSV Editor";
                winCsvEditor.Owner = this;
                winCsvEditor.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
                winCsvEditor.CanClose = true;
                winCsvEditor.ShowDialog();
            }
            else
            {
                MessageBox.Show("No Variables available to edit");
            }

The output is shown as shown int he attachment. 

Not exactly the output I was looking for. 
Since the string[] keeps changing each time I call the GridView depending on the parameters. How do I dynamically build the RadGridView. ?? Any helps is appreciated. 
Dimitrina
Telerik team
 answered on 05 Jan 2015
1 answer
113 views
How do I pin/unpin "ALL panes at once" from the "Pin icon" in the top right corner of the pane? I appreciate any help anyone can provide. 
I need to Pin/UnPin all RadPanes when the pin-button is pressed once on any pane. I've been searching the web, forums, and help tickets for a solution. The zipped solution telerik supplies doesn't work correctly and I see mention of a bug regarding loss of state from last April.  I use a toggle button on a radRibbon to handle all panes:

                    <telerik:RadRibbonToggleButton Name="btnToggleInformationPanes" Text="Toggle Pane" LargeImage="/Drill-IT;component/Resources/Icons/WindowList_64.png" Checked="ToogleInformationPanes_Checked" Unchecked="ToogleInformationPanes_Unchecked" IsAutoSize="True" Size="Large">

        private void ToogleInformationPanes_Checked(object sender, RoutedEventArgs e)
        {
            LeftGroupPane.UnpinAllPanes();
        }

        private void ToogleInformationPanes_Unchecked(object sender, RoutedEventArgs e)
        {
            LeftGroupPane.PinAllPanes();
            LeftGroupPane.SelectedIndex = 0;
        }

But I have been unable to duplicate this action in the Selection changed method. This method gets called multiple times, loses track of the state, and only one pane is pinned/unpinned.

        private void LeftGroupPane_SelectionChanged(object sender, RadSelectionChangedEventArgs e)
        {
            if (btnToggleInformationPanes.IsChecked == true)
            {
                ToogleInformationPanes_Checked(sender, e);
            }
            else
            {
                ToogleInformationPanes_Unchecked(sender, e);
            }
        }

How do I pin/unpin ALL panes with one click from the "Pin icon" in the top right corner of the pane?

Thanks for your help! I appreciate it!!!
Vladi
Telerik team
 answered on 05 Jan 2015
2 answers
66 views
We use prism with RadDocking
In the Shell view we have this region :


<telerik:RadSplitContainer InitialPosition="DockedRight" telerik:ProportionalStackPanel.RelativeSize="200, 10">
<telerik:RadPaneGroup prism:RegionManager.RegionName="{x:Static inf:RegionNames.RightSidebarRegion}"/>
</telerik:RadSplitContainer>

When we inject this view  that has IsPinned="False"

<Telerik:RadPane …............….. IsPinned="False">
<Grid>
      <TextBlock Text="some text"/>
</Grid>
</Telerik:RadPane>

We notice that when we navigate to view that have not pane,
the pas injected in the precedent view not removed

IRegion sidebarRegion =  RegionManager.Regions[RegionNames.RightSidebarRegion];
SideBars.ToList().ForEach(sidebarRegion.Remove);

Can you give me a solution for this behavior?


George
Telerik team
 answered on 05 Jan 2015
2 answers
199 views
EDIT: I solved the issue, I just had to create a new background worker for each series.

Hey peeps,

I'm just getting started with Telerik's controls and have successfully managed to plot a multi series chart. Now due to the time it takes to populate the chartdata, I wanted to do this with a background worker. I successfully managed to have a backgroundworker plot a single chartseries, but I don't know how to have it plot multiple. Lets look at the code:


public BackgroundWorker worker = new BackgroundWorker();
 public Window1()
 {
     InitializeComponent();
     InitializeBackgroundWorker();
 }
 
 // Set up the BackgroundWorker object by 
 // attaching event handlers. 
 private void InitializeBackgroundWorker()
 {
     worker.DoWork +=new DoWorkEventHandler(worker_DoWork);
     worker.RunWorkerCompleted +=new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
 }
 
 //Define a New Chart Data Class for each graph
 public class ChartDataClass1
 {
     public double X1 { get; set; }
     public double Y1 { get; set; }
 
     public ChartDataClass1()
     {
 
     }
 }
 
 public class ChartDataClass2
 {
 
     public double X2 { get; set; }
     public double Y2 { get; set; }
 
     public ChartDataClass2()
     {
 
     }
 }
 
 private void btn1_Click(object sender, RoutedEventArgs e)
 {
     worker.RunWorkerAsync();
 }
 
 void worker_DoWork(object sender, DoWorkEventArgs e)
 {
     // On the worker thread...cannot make UI calls from here.
     e.Result = MTLB(worker,e);
 
 
private void worker_RunWorkerCompleted(
     object sender, RunWorkerCompletedEventArgs e)
 {
      
     // First, handle the case where an exception was thrown.
     if (e.Error != null)
     {
         MessageBox.Show(e.Error.Message);
     }
 
     else
     {
         // Finally, handle the case where the operation 
         // succeeded.
         xline.Series[0].ItemsSource = (System.Collections.IEnumerable)e.Result;
     }
 
 }
 
 public System.Collections.Generic.List<ChartDataClass1> MTLB(BackgroundWorker worker, DoWorkEventArgs e)
 {
     int st = 1;
     int sp = 20;
  
     //MATLAB inputs
     MWNumericArray start = 1;
     MWNumericArray stop = 20;
 
     //MATLAB fn
     Reactor.Class1 rxtr_lib = new Reactor.Class1();
     MWArray[] result = rxtr_lib.rxtr(1, start, stop);
     System.Array NH3 = new double[2 * (sp - st + 1)];
     NH3 = ((MWNumericArray)result[0]).ToVector(MWArrayComponent.Real);
 
 
     List<ChartDataClass1> chartData1 = new List<ChartDataClass1>();
     List<ChartDataClass2> chartData2 = new List<ChartDataClass2>();
     for (int i = 0; i < (sp - st); i++)
     {
         ChartDataClass1 cdc = new ChartDataClass1();
         ChartDataClass2 cdc2 = new ChartDataClass2();
         cdc.X1 = i;
         cdc.Y1 = Convert.ToDouble(NH3.GetValue(2 * i));
         cdc2.X2 = i;
         cdc2.Y2 = Convert.ToDouble(NH3.GetValue(2 * i + 1));
 
         chartData1.Add(cdc);
         chartData2.Add(cdc2);
     }
      
     return chartData1;
     
}

The code above populates chartData1 and chartData2, but only allows me to return a single type(chartdataclass1 OR chartdataclass2). My question is, what must I do so that I can return chartData1 AND chartData2 to e.Result? Also, assuming I can return both, how do I then set up e.Result such that I can define Series[0] and Series[1] using e.Result?

Martin Ivanov
Telerik team
 answered on 05 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?