Telerik Forums
UI for WPF Forum
1 answer
212 views
We have this strange issue where we have a RadComboBox that we interact with from the code behind.

Basically in certain situations, we want to change the SelectedItem or SelectedValue without firing off our SelectionChanged Event Handler. So we are first Unsubscribing our event handler from the RadComboBox like this:

radComboBox.SelectionChanged -= new SelectionChangedEventHandler(ourEventHandler);

We then set our SelectedItem property to the value we want like so:

radComboBox.SelectedItem = outItem;

And then we resubscribe to the SelectionChanged event like so:

radComboBox.SelectedItem += new SelectionChangedEventHandler(ourEventHandler);

The idea is that while we set our SelectedItem, there should be no event set and nothing should fire. However, this is not the case. Instead as soon as we resubscribe to the event, the event fires all the same. Is this a bug?
Ristogod
Top achievements
Rank 2
 answered on 17 Feb 2011
6 answers
466 views
I am new to WPF Controls, we are using RAD Grid view in my project, this is a touch screen application. my question is .
Is there any way that i can show the horizontal scrollbar on the top of the column header and i want to show the horizontal scrollbar right after the frozen column. not from the begining of the grid.

regards
sarag.
sarag
Top achievements
Rank 1
 answered on 17 Feb 2011
1 answer
186 views
Can someone please explain how to cancel a drop operation? I tried the delayed drag/drop example before with mixed results. It seems now with the latest release things may have changed on how this may be accomplished.

Scenario:
Upon drop, get the slot time and resource in the destination slot. Create update back to the DB. If that update fails, cancel the drop operation and make sure the appoitment ends up in the position where it started.

Thanks,
Rod
George
Telerik team
 answered on 17 Feb 2011
1 answer
482 views
I am trying to do something extremely simple.
I am trying to populate a GridViewComboBoxColumn with a list of numbers ranging from 1 - 16.
This is what I have so far:

<Window x:Class="Login"
        xmlns:systhreading="clr-namespace:System.Threading;assembly=mscorlib"
        xmlns:myNamespace="clr-namespace:myNamespace"
        xmlns:primatives="clr-namespace:System.Windows.Controls.Primitives;assembly=PresentationFramework"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        Title="Login" Height="768" Width="1024" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Window.Resources>
        <Style TargetType="Label">
            <Setter Property="Width" Value="100"></Setter>
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="Width" Value="100"></Setter>
        </Style>
        <myNamespace:TestUser x:Key="testUser"/ >
        <x:Array x:Key="PortValues" Type="sys:Int32">
            <sys:Int32>1</sys:Int32>
            <sys:Int32>2</sys:Int32>
            <sys:Int32>3</sys:Int32>
            <sys:Int32>4</sys:Int32>
            <sys:Int32>5</sys:Int32>
            <sys:Int32>6</sys:Int32>
            <sys:Int32>7</sys:Int32>
            <sys:Int32>8</sys:Int32>
            <sys:Int32>9</sys:Int32>
            <sys:Int32>10</sys:Int32>
            <sys:Int32>11</sys:Int32>
            <sys:Int32>12</sys:Int32>
            <sys:Int32>13</sys:Int32>
            <sys:Int32>14</sys:Int32>
            <sys:Int32>15</sys:Int32>
            <sys:Int32>16</sys:Int32>
        </x:Array>
    </Window.Resources>
    <DockPanel DataContext="{Binding Source={StaticResource testUser}}">
        <StackPanel DockPanel.Dock="Top" VerticalAlignment="Stretch" HorizontalAlignment="Center">
           <telerik:RadGridView Name="RadGridView1" ItemsSource="{Binding FooBars}">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewComboBoxColumn
                       Header="Something"
                       ItemsSource="{Binding Source={StaticResource PortValues}}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </StackPanel>
      
    </DockPanel>
</Window>


This is my "TestUser" and "FooBar" classes that I am using for testing:

Imports System.ComponentModel
Imports System.Collections.ObjectModel
 
Public Class TestUser
 
    Private _fooBars As ObservableCollection(Of FooBar)
 
    Public Property FooBars As ObservableCollection(Of FooBar)
        Get
            Return _fooBars
        End Get
        Set(ByVal value As ObservableCollection(Of FooBar))
            _fooBars = value
        End Set
    End Property
 
    Public Sub New()
        _fooBars = New ObservableCollection(Of FooBar)
        For i As Integer = 0 To 10
            _fooBars.Add(New FooBar("FooBar" + i.ToString, i))
        Next
    End Sub
End Class
Public Class FooBar
    Public Property Value As Integer
    Public Property Name As String
 
    Public Sub New(ByVal name As String, ByVal value As Integer)
        Me.Value = value
        Me.Name = name
    End Sub
End Class


For some reason I cannot get the GridViewComboBoxColumn to populate with the "PortValues" (I can't even get it to appear).
What am I doing wrong?!?!

Thanks a lot for your help!

-Newbie
Maya
Telerik team
 answered on 17 Feb 2011
1 answer
60 views

 

 

 

RadCalendar c = new RadCalendar();
c.FirstDayOfWeek = null;

See the method (RadCalendar.):

private static bool IsValidFirstDayOfWeek(object value)
{
    DayOfWeek? nullable = (DayOfWeek?) value;
    return (Enum.IsDefined(typeof(DayOfWeek), nullable) || !nullable.HasValue); // ???
}

I getting "throw ArgumentNullException: Value cannot be null.Parameter name: value"

Maybe code change to:

private static bool IsValidFirstDayOfWeek(object value)
{
    DayOfWeek? nullable = (DayOfWeek?) value;
    return (!nullable.HasValue || Enum.IsDefined(typeof(DayOfWeek), nullable.Value));
}

Its really working without exceptions!

Kaloyan
Telerik team
 answered on 17 Feb 2011
2 answers
153 views
Hello!

I have a problem: I want to get image from chart on service. I use ExportToImage method to do this. By default - it's work fine. But when I try to apply any style to the chart (i.e. set Axis title style for changing font size, I using Axis.AxisStyles.TitleStyle property) I get following error:

WcfDataService.Code.PdfGenerator - Couldn't get chart snapshot.
System.Windows.Markup.XamlParseException: '11' is not a valid value for the 'System.Windows.Documents.TextElement.FontSize' property on a Setter. ---> System.ArgumentException: '11' is not a valid value for the 'System.Windows.Documents.TextElement.FontSize' property on a Setter.
   at System.Windows.Setter.Seal()
   at System.Windows.SetterBaseCollection.Seal()
   at System.Windows.Style.Seal()
   at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
   at System.Windows.FrameworkElement.OnStyleChanged(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.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot)
   at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
   at System.Windows.FrameworkTemplate.InvalidatePropertiesOnTemplate(DependencyObject container, Object currentObject)
   at System.Windows.FrameworkTemplate.HandleBeforeProperties(Object createdObject, DependencyObject& rootObject, DependencyObject container, FrameworkElement feContainer, INameScope nameScope)
   at System.Windows.FrameworkTemplate.<>c__DisplayClass6.<LoadOptimizedTemplateContent>b__3(Object sender, XamlObjectEventArgs args)
   at System.Xaml.XamlObjectWriter.OnBeforeProperties(Object value)
   at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.Charting.ChartArea.MeasureOverride(Size availableSize) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\ChartArea\ChartArea.Core.cs:line 1318
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Telerik.Windows.Controls.RadDockPanel.MeasureOverride(Size availableSize) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Panels\RadDockPanel.cs:line 170
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Telerik.Windows.Controls.Charting.ScalePanel.MeasureOverride(Size availableSize) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\ScalePanel.cs:line 70
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.RadChart.MeasureOverride(Size availableSize) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 910
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)

Can you help me? What can I do to fix this problem?

Thanks, Anatoly Chekh.
Anatoly Chekh
Top achievements
Rank 1
 answered on 17 Feb 2011
0 answers
118 views
Hello Telerik Team,
                                 I have some problem in Debugging.Here in my WPF project using telerik rad controls.if i am using  windows application mean easily find out error using line by line debugging.

but i am not able to debug wpf project. is it any problem when i am using telerik controls?

sivakanth
Top achievements
Rank 1
 asked on 17 Feb 2011
1 answer
98 views
I want to prevent dragging items to the same level as the root, how do I do this?

thanks.
Petar Mladenov
Telerik team
 answered on 17 Feb 2011
1 answer
114 views
Greetings,

I am trying to upgrade my telerik wpf controls to the latest build according to this article: http://www.telerik.com/help/silverlight/installation-upgrading-from-trial-to-developer-license.html

So first I want to remove telerik controls from gac. And here is the problem. In my VS 2010 I can see telerik libraries in .NET tab when adding a reference (see references.png). But when I try to run gacutil -u Telerik.Windows.Controls.dll as metioned here: http://www.telerik.com/help/wpf/installation-deployment-add-remove-to-gac-wpf.html I get this message: 

No assemblies found matching: Telerik.Windows.Controls.dll
Number of assemblies uninstalled = 0
Number of failures = 0

So how can I upgrade my telerik radcontrols for wpf?

Thank you in advance
Miro

Milan
Telerik team
 answered on 17 Feb 2011
2 answers
109 views
I have added a handler to VisibleRangeChanged event to query the database for appointments within the new date range. However, the appointment source that is updated does not get reflected on the current view. If I switch to another view and back again, I see the appointments.

Is there a way to fix this so that I see my appointments when the AppointmentSource is udpated?

Thanks,
Rod
Hristo
Telerik team
 answered on 17 Feb 2011
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?