Telerik Forums
UI for WPF Forum
3 answers
52 views
Hello,

I'm trying to add an event handler for the RowDetailsVisibilityChangingEvent, but I get a compiler error.

Shouldn't this be possible:

Tb.AddHandler(

 

GridViewDataControl.RowDetailsVisibilityChangingEvent, new RoutedEventHandler(GridView_VisibilityChangingEvent));
The doc says it's part of the GridViewDataControl class.

Best regards
Oliver

 

Stephan
Top achievements
Rank 1
 answered on 13 Dec 2011
2 answers
103 views
Hi,

How can I add a marked zone in a programmatically way? I tried to look in the chart area object within the radchart but I couldn't find it.
I'm working with WPF.

Cheers
Goncalo
Top achievements
Rank 1
 answered on 13 Dec 2011
6 answers
685 views

 

Hi,

I have a main application and when the user click on a button, I create a dialog to display some informations. When a display this dialog, I restore his persistence and whe the user close this dialog, I save his persistence. After 2 or 3 attempts of displaying this dialog, my main application throw me an exception.

Environment:
VS2008
DotNet: 3.5
Telerik: 2011.3.1116.35

Here is my main application call:

private void btnPhone_Click(object sender, RoutedEventArgs e)

{

ReferringInfos dialog = new ReferringInfos(mDataSource, mCurrentVisit.ReferringPhysician, mCurrentVisit.ReferringPhones, true);

dialog.ShowDialog();

}

Here is my ReferringInfos class and xaml:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

using com.ChristieGrp.Localisation;

using com.christiegrp.Neuron.Client;

using Telerik.Windows.Controls;

namespace com.christiegrp.Neuron.ClientApplication

{

/// <summary>

/// Interaction logic for ReferringInfos.xaml

/// </summary>

public partial class ReferringInfos : RadWindow

{

#region Constructors.

static ReferringInfos()

{

StyleManager.ApplicationTheme = new Office_BlueTheme();

LocalizationManager.Manager = new CustomLocalizationManager();

}

public ReferringInfos(NeuronDataSource pDataSource, string pReferringName, ShortPhoneNumber[] pPhoneList, Boolean pPersistence)

{

InitializeComponent();

mDataSource = pDataSource;

mPersistence = pPersistence;

this.ReferringName = pReferringName;

mPhoneNumbers = new List<PhoneNumber>();

fillPhoneNumbers(pPhoneList);

radGridView.ItemsSource = mPhoneNumbers;

Header = mDataSource.BuildFormName(LocGeneral.GetControlText("ReferringInfos"));

}

#endregion

#region Dependency properties.

public static readonly DependencyProperty ReferringNameProperty = DependencyProperty.Register("ReferringName", typeof(string), typeof(ReferringInfos));

#endregion

#region Public properties.

public string ReferringName

{

get

{

return (string)GetValue(ReferringNameProperty);

}

set

{

SetValue(ReferringNameProperty, value);

}

}

#endregion

#region Private methods.

private void fillPhoneNumbers(ShortPhoneNumber[] pPhoneList)

{

foreach (ShortPhoneNumber item in pPhoneList)

{

PhoneNumber phone = new PhoneNumber();

phone.Number = item.PhoneNumber;

phone.TypeCode = item.TypeCode;

mPhoneNumbers.Add(phone);

}

}

#endregion

#region Private events handler.

/// <summary>

/// Change dialog resources.

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

private void ReplaceLanguageResources(object sender, EventArgs e)

{

Localisation.SetUILanguage(this, "ReferringInfos", mDataSource);

}

/// <summary>

/// Dialog is closing.

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

private void RadWindow_PreviewClosed(object sender, WindowPreviewClosedEventArgs e)

{

if (mPersistence)

{

string errMsg;

PersistenceStorage.Persist(PersistenceStorage.PersistenceAction.Save, out errMsg);

}

}

/// <summary>

/// Dialog is loaded.

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

private void RadWindow_Loaded(object sender, RoutedEventArgs e)

{

if (mPersistence)

{

string errMsg;

PersistenceStorage.Persist(PersistenceStorage.PersistenceAction.Load, out errMsg);

}

}

/// <summary>

/// Close request.

/// </summary>

/// <param name="sender"></param>

/// <param name="e"></param>

private void btnClose_Click(object sender, RoutedEventArgs e)

{

Close();

}

#endregion

#region Private fields.

private NeuronDataSource mDataSource;

private Boolean mPersistence;

private List<PhoneNumber> mPhoneNumbers;

#endregion

}

/// <summary>

/// Class to hold a list of phone numbers.

/// </summary>

public class PhoneNumber

{

public string Number { get; set; }

public string TypeCode { get; set; }

}

}

 

<telerik:RadWindow x:Class="com.christiegrp.Neuron.ClientApplication.ReferringInfos"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

Height="300" Width="450" SizeToContent="False" Name="Me"

WindowStartupLocation="CenterScreen" PreviewClosed="RadWindow_PreviewClosed" Loaded="RadWindow_Loaded" ResizeMode="NoResize"

telerik:PersistenceManager.StorageId="ReferringInfos">

<telerik:RadWindow.IconTemplate>

<DataTemplate>

<Image Source="Resources/Doctor_48x48.png" Height="24" Width="24" Stretch="Fill" Margin="0 0 3 0" />

</DataTemplate>

</telerik:RadWindow.IconTemplate>

<telerik:RadWindow.Resources>

<ResourceDictionary>

<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="ReferringInfos-Fr-Res.xaml"/>

<ResourceDictionary Source="/Telerik.Windows.Controls.Navigation;component/Themes/GenericOfficeBlack.xaml"/>

</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>

</telerik:RadWindow.Resources>

<Grid Margin="5">

<Grid.ColumnDefinitions>

<ColumnDefinition Width="*"/>

<ColumnDefinition Width="Auto"/>

</Grid.ColumnDefinitions>

<Grid.RowDefinitions>

<RowDefinition Height="Auto"/>

<RowDefinition Height="*"/>

<RowDefinition Height="Auto"/>

</Grid.RowDefinitions>

<!-- The following element is used to trigger an event allowing to replace the language resources before they are used. -->

<TextBlock Initialized="ReplaceLanguageResources"/>

<StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Orientation="Horizontal">

<Image Source="Resources/Doctor_48x48.png" Height="32" Width="32" Stretch="Fill" />

<Label Margin="5" FontSize="16" VerticalAlignment="Center" Content="{Binding ElementName=Me, Path=ReferringName}"/>

</StackPanel>

<telerik:RadGridView Name="radGridView" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" ShowGroupPanel="False" IsSynchronizedWithCurrentItem="True" IsReadOnly="True" SelectionMode="Single" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" SelectionUnit="FullRow">

<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn IsGroupable="False" IsFilterable="False" DataMemberBinding="{Binding Path=Number}" Header="{StaticResource Number}" />

<telerik:GridViewDataColumn IsGroupable="False" IsFilterable="False" DataMemberBinding="{Binding Path=TypeCode}" Header="{StaticResource Type}" />

</telerik:RadGridView.Columns>

</telerik:RadGridView>

<telerik:RadButton Grid.Column="1" Grid.Row="2" Margin="0 5 0 0" Name="btnClose" Click="btnClose_Click">

<StackPanel Orientation="Horizontal">

<Image Margin="5 0 0 0" Source="Resources/Close_32x32.png" Height="24" Width="24" />

<TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Close}"/>

</StackPanel>

</telerik:RadButton>

</Grid>

</telerik:RadWindow>

Here is my log:
2011-12-01 23:41:29,660;[5852];ERROR;MNGUI016;System.Windows.Markup.XamlParseException: La valeur « ReferringInfos » ne peut pas être attribuée à la propriété « StorageId » de l’objet « com.christiegrp.Neuron.ClientApplication.ReferringInfos ». Un élément avec la même clé a déjà été ajouté.  Erreur à l’objet « Me » dans le fichier de balisage « ClientHelper;component/referringinfos.xaml » ligne 7 position 5. ---> System.ArgumentException: Un élément avec la même clé a déjà été ajouté.
   à System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   à System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   à System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   à Telerik.Windows.PersistenceFramework.ObjectStorage.AddItemToStorage(String key, DependencyObject item)
   à Telerik.Windows.Persistence.PersistenceManager.OnStorageIdChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
   à System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   à System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   à System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   à System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   à System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
   à System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   à System.Windows.Markup.BamlRecordReader.SetDependencyValueCore(DependencyObject dependencyObject, DependencyProperty dependencyProperty, Object value)
   à System.Windows.Markup.BamlRecordReader.SetDependencyValue(DependencyObject dependencyObject, DependencyProperty dependencyProperty, Object value)
   à System.Windows.Markup.BamlRecordReader.SetPropertyValue(Object o, PropertyDefinition propertyDefinition, Object value)
   à System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
   --- Fin de la trace de la pile d'exception interne ---
   à System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
   à System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
   à System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
   à System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
   à System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
   à System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   à System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
   à System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
   à System.Windows.Markup.TreeBuilder.Parse()
   à System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   à System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   à com.christiegrp.Neuron.ClientApplication.ReferringInfos.InitializeComponent() dans d:\Developpement\GestX.Courant\RisGC\Client\ClientHelper\ReferringInfos.xaml:ligne 1
   à com.christiegrp.Neuron.ClientApplication.ReferringInfos..ctor(NeuronDataSource pDataSource, String pReferringName, ShortPhoneNumber[] pPhoneList, Boolean pPersistence) dans D:\Developpement\GestX.Courant\RisGC\Client\ClientHelper\ReferringInfos.xaml.cs:ligne 36
   à com.christiegrp.Neuron.ClientApplication.DictationForm.btnPhone_Click(Object sender, RoutedEventArgs e)
   à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   à System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   à System.Windows.Controls.Primitives.ButtonBase.OnClick()
   à System.Windows.Controls.Button.OnClick()
   à Telerik.Windows.Controls.RadButton.OnClick()
   à System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   à System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   à System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   à System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   à System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
   à System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   à System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   à System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   à System.Windows.Input.InputManager.ProcessStagingArea()
   à System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   à System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   à System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   à System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   à System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   à System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   à System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   à System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   à System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
   à System.Windows.Forms.NativeWindow.WndProc(Message& m)
   à System.Windows.Forms.Integration.WindowsFormsHost.ActivateWindowListener.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   à System.Windows.Window.ShowHelper(Object booleanBox)
   à System.Windows.Window.Show()
   à System.Windows.Window.ShowDialog()
   à Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(Boolean isModal)
   à Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal)
   à Telerik.Windows.Controls.RadWindow.ShowDialog()
   à com.christiegrp.Neuron.ClientApplication.DictationModuleWPF.StartFunction()
   à com.christiegrp.Neuron.ClientApplication.MainGui.listView_ItemActivate(Object sender, EventArgs e) dans D:\Developpement\GestX.Courant\RisGC\Client\Neuron\MainGui.cs:ligne 1031

 

 

 

Tina Stancheva
Telerik team
 answered on 13 Dec 2011
1 answer
69 views
In my RadChart (2011 - Q3), I have two Y axis. I would like to have a custom grid line drawn against my second Y Axis, which is named 'CdSimStdDev'. Is this possible to do in XAML. I don't see a way to specify the name of a Y axis to associate with the custom line.
Thank you.
Randy Minder
Top achievements
Rank 1
 answered on 13 Dec 2011
11 answers
146 views
Hi

I would like to control the visibility of the backstage component via my viewmodel through databinding, see below.

IsBackstageOpen="{Binding BackstageIsOpen}"

Although I get no errors, the ribbon is not responding to changes in my property value. (I am notifying the property change).

Any ideas?
ITC
Top achievements
Rank 1
 answered on 13 Dec 2011
1 answer
165 views
Hi!

I am looking for a Telerik text box control that does validation of the data when the "Enter" key is hit.  The validation should be similar to the Telerik data grid.  On the data grid the "Enter" key forces a validation without losing focus.  Is there a telerik textbox control available that I can take advantage of?  if you can show me an example that shows how to implement this.

For example:  If the textbox is bound to a number and user enters a letter and presses "Enter" then the border of the textbox get highlighted to red without losing focus.

Thanks,

Sonia
Boby
Telerik team
 answered on 13 Dec 2011
1 answer
185 views
Hello,

I try to display a list of UserControls in a RadTabControl and to use a UserControl property (name) to display tab header and dropdown items.

According to this post (http://www.telerik.com/community/forums/wpf/tabcontrol/radtabitem-headertemplate-not-responding-to-binding-to-usercontrol-object-properties.aspx), I succeded in displaying Tab Header with UserControl "Name" property.
To do this, I use a RelativeSource :

Text

 

 

="{Binding DataContext.Name, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=telerik:RadTabItem}}"

 


I have used your TabControl-Q1.zip sample project (from post above) where I have modified MainWindow.xaml.cs file to create a list of UserControls :

this

 

 

.radtabVariableControlsContainer.ItemsSource =

 

 

 

Enumerable.Range(0, 10).Select(x => new UserControl() { Name = "name" + x });

 


My RadTabControl and related template definition is this one :
<Grid>
  
        <Grid.Resources>
  
            <DataTemplate x:Key="ContentAreaTabHeaderTemplate">
                <TextBlock Text="{Binding DataContext.Name, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=telerik:RadTabItem}}" FontFamily="Arial" FontSize="13.333" />
            </DataTemplate>
  
        </Grid.Resources>
  
        <telerik:RadTabControl x:Name="radtabVariableControlsContainer"                               
                               BorderBrush="{x:Null}"
                               SelectedItemRemoveBehaviour="SelectPrevious"
                               ItemTemplate="{StaticResource ContentAreaTabHeaderTemplate}"
                               DropDownDisplayMode="Visible"
                               ItemDropDownContentTemplate="{StaticResource ContentAreaTabHeaderTemplate}"/>
  
    </Grid>

It so work find for ItemTemplate to display Tabs Header, but I don't succeed in displaying UserControls names in DropDown.
The "name" property never appear in dropdown...

Many thanks for your help !

Yann
Petar Mladenov
Telerik team
 answered on 13 Dec 2011
1 answer
62 views
I am using RadChart Q3 2011. I am attempting to bind the YIntercept to a value coming from my view model. I have the following XAML:

<charting:ChartArea.Annotations>
   <charting:CustomGridLine YIntercept="{Binding Path=TargetThickness}" Visibility="Visible" Stroke="Red" StrokeThickness="
</charting:ChartArea.Annotations>

The problem is that it's not displaying the value contained in the TargetThickness property. Is the syntax not correct?
Petar Marchev
Telerik team
 answered on 13 Dec 2011
4 answers
180 views
Hello,

Could you please give me some hints how to enforce gridview control to mark as selected record for which I'm clicking togglebutton to display rowdetails. I found an example for Silverlight in which it work as desired for my WPF app http://www.telerik.com/community/forums/silverlight/general-discussions/togglebutton.aspx

When I click the rowdetails toggle button it shows that details but also marks the parent row as selected. 

Regards
Andy 
AndyL
Top achievements
Rank 1
 answered on 13 Dec 2011
1 answer
117 views
Hi

I am performing an operation while the backstage part of the ribbon is open e.g. opening a file form the recent files section.

My busy indicator set as the root object of the xaml page works when backstage is not open, but when the backstage is open I get no feedback.

Any ideas?
Ivo
Telerik team
 answered on 13 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?