Telerik Forums
UI for WPF Forum
2 answers
318 views
Why doesn't this work?

 

/// <summary>  
/// Satisfies req for IPartnerMessenger. Dynamically Loads Partner radtab content.  
/// </summary>  
/// <param name="PartnerType"></param>  
/// <param name="partner"></param>  
public void NotifyPartnerSelection(Type PartnerType, Partner partner)  
{  
    if (PartnerType == typeof(EmailPartner))  
    {  
        this._selectedPartner = (EmailPartner)partner;  
        this.PartnerRadTabItem.SetValue(RadTabItem.ContentProperty, new EmailPartnerView(this, (EmailPartner)partner));  
    }  
    else if (PartnerType == typeof(NamedCallPartner))  
    {  
        this._selectedPartner = (NamedCallPartner)partner;  
        this.PartnerRadTabItem.SetValue(RadTabItem.ContentProperty, new NamedCallPartnerView(this, (NamedCallPartner)partner));  
    }  
    else if (PartnerType == typeof(AnonymousCallPartner))  
    {  
        this._selectedPartner = (AnonymousCallPartner)partner;  
        this.PartnerRadTabItem.SetValue(RadTabItem.ContentProperty, new AnonymousCallPartnerView(this, (AnonymousCallPartner)partner));  
 
    }  
    else 
        ClientErrorHelper.ShowError(new Exception("Stuff went wrong"));  
 
    } 

 

I have tried it as just setting the content property directly as well. Basically it works for the first assignment to the content property and then all other setting attempts although the radtabitem.content property changes, the user control displayed in the tab does not change.

 

 

 

 

 

 

Miro Miroslavov
Telerik team
 answered on 15 May 2010
5 answers
540 views
HI Team,

I'm Using Rad Drop Down Button. Can we bind dynamic data to it. Is there any thing similar to Itemssource kind of thing.
Please do needfull to me. Its an Ugent requirement.
Tina Stancheva
Telerik team
 answered on 15 May 2010
4 answers
190 views

I’m using a generic item wrapper defined as below:

    public class ItemWrapper

    {

        public State State { get; set; }

        public string Message { get; set; }

        public object Item { get; set; }

    }

    public enum State

    {

        Ok,

        Warning,

        Error

    }

 

The ItemWrapper could contain objects from different classes in the Item property; for instance:

 

ItemWrapper wrapper = new ItemWrapper();

wrapper.Item = new Company() {Id = "Acme", Desc="Acme company" };

 

The point is how to bind RadGridView columns to show both ItemWrapper columns (State and Message) and wrapped object columns ( Company.Id and Company.Desc).

Binding ItemWrapper properties is ok while the expected way for Company should be:

col.DataMemberBinding = new Binding("Item.Id");

col.DataType = typeof(string);

 

that seems, at least, to work but raising lot of exceptions:

A first chance exception of type 'System.ArgumentException' occurred in Telerik.Windows.Data.dll

 

that slow down rows loading to several second for few items (making control unusable) .

Sincerely

Stefan Dobrev
Telerik team
 answered on 14 May 2010
2 answers
610 views

I need to be able to filter the RadGridView based on a collection property on each item. Here is a sample to illustrate my case. Let’s suppose that each item in the grid is of type Person and each person has a collection property ScheduledMeetings. I need to apply some kind of filter that does the following:

People.Where(p => p. ScheduledMeetings.Contains(someMeeting))

which will return all people participating in the specified meeting.

The documentation samples all use the built-in CreateFilterExpression method of the FilterDescriptor class. So my first choice was to use the existing FilterDescriptor class in combination with FilterOperator.Contains but it seems that ‘Contains’ only works with strings and not with IEnumerable (even with FilterDescriptor.MemberType specified)!

 I suppose I need to implement some custom FilterDescriptor class inheriting from FilterDescriptorBase and then provide the Expression from the CreateFilterExpression override. But how do I create such expression?

Todor
Top achievements
Rank 1
 answered on 14 May 2010
1 answer
361 views
Hello,
I'm playing around with the Slider control and im trying to find a way to customize it. Basically all I'm looking for is to increase the actual slider bar to approx. the same height as the thumbs themselves to give it more of a sliding progress bar look. Also maybe customize the sliders themselves a little bit. Is this possible somehow using WPF?
Dimitrina
Telerik team
 answered on 14 May 2010
3 answers
257 views
Hi I have issue whit theme changing in RadDock control. When I use StyleManager.SetTheme method for different controls everything works fine. But if I do this with StyleManager.SetTheme(myDock,new Windows7Theme()); then this method destroys the layout and disables the layout loading (to recover previous layout). App hangs and layout doesn't recover correctly. I need to implement the dynamic themes changing but RadDock doesn't seem to work fine.
Pana
Telerik team
 answered on 14 May 2010
1 answer
181 views
Hi,
I have two RadPane elements in RadPaneGroup at left container of my Wpf window. I initialized IsSelected property of RadPane elements at run-time, but it was not select any RadPane element which I want to select.  
Konstantina
Telerik team
 answered on 13 May 2010
2 answers
331 views
Hopefully someone can shed some light on these issues for me.

I have 3 states for my listitems (normal, clicked, highlighted) and would like these states to expand the entire length of the treeview control on mouse hover, selected, unselected.  I would also like to remove the expand buttons and have the treeview expand when a user clicks on the main item.  I found this example and thought there had to be an easier way for the treeview selection.  I hope there is!  Any help would be most appreciated.

The good news is that I got databinding working :)

A picture of my problems can be see here

Thanks in advance
Ryan

My xml is as follows:
<?xml version="1.0" encoding="utf-8" ?> 
<Scenes> 
  <Scene name="Test"
    <Procedures> 
      <Procedure name="Ryan" /> 
      <Procedure name="Rocks" /> 
      <Procedure name="AT" /> 
      <Procedure name="Photoshop" /> 
    </Procedures> 
  </Scene> 
  <Scene name="Test2"
    <Procedures> 
      <Procedure name="WPF" /> 
      <Procedure name="Is" /> 
      <Procedure name="The" /> 
      <Procedure name="Best" /> 
      <Procedure name="Language" /> 
    </Procedures> 
  </Scene> 
  <Scene name="Test3"
    <Procedures> 
      <Procedure name="Firefox" /> 
      <Procedure name="IE" /> 
      <Procedure name="And" /> 
      <Procedure name="Opera" /> 
      <Procedure name="All" /> 
      <Procedure name="Suck" /> 
    </Procedures> 
  </Scene> 
</Scenes> 

And my mostly copied example code is below:
<Window xmlns:my1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"  xmlns:my="clr-namespace:CustomItemsPanel.ListBox"  x:Class="CustomItemsPanel.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:CustomItemsPanel" 
    xmlns:Telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    Title="Custom ItemsPanel" Height="461" Width="615" 
    WindowStartupLocation="CenterScreen" 
    > 
 
    <Window.Resources> 
        <!-- List Item Selected --> 
        <LinearGradientBrush x:Key="GotFocusStyle"  EndPoint="0.5,1" StartPoint="0.5,0"
            <LinearGradientBrush.GradientStops> 
                <GradientStop Color="Black" Offset="0.501"/> 
                <GradientStop Color="#FF091F34"/> 
                <GradientStop Color="#FF002F5C" Offset="0.5"/> 
            </LinearGradientBrush.GradientStops> 
        </LinearGradientBrush> 
 
        <!-- List Item Hover --> 
        <LinearGradientBrush x:Key="MouseOverFocusStyle" StartPoint="0,0" EndPoint="0,1"
            <LinearGradientBrush.GradientStops> 
                <GradientStop Color="#FF013B73" Offset="0.501"/> 
                <GradientStop Color="#FF091F34"/> 
                <GradientStop Color="#FF014A8F" Offset="0.5"/> 
                <GradientStop Color="#FF003363" Offset="1"/> 
            </LinearGradientBrush.GradientStops> 
        </LinearGradientBrush> 
 
        <!-- List Item UnSelected --> 
        <LinearGradientBrush x:Key="LostFocusStyle" EndPoint="0.5,1" StartPoint="0.5,0"
            <LinearGradientBrush.RelativeTransform> 
                <TransformGroup> 
                    <ScaleTransform CenterX="0.5" CenterY="0.5"/> 
                    <SkewTransform CenterX="0.5" CenterY="0.5"/> 
                    <RotateTransform CenterX="0.5" CenterY="0.5"/> 
                    <TranslateTransform/> 
                </TransformGroup> 
            </LinearGradientBrush.RelativeTransform> 
            <GradientStop Color="#FF091F34" Offset="1"/> 
            <GradientStop Color="#FF002F5C" Offset="0.4"/> 
        </LinearGradientBrush> 
 
        <!-- List Item Highlight --> 
        <SolidColorBrush x:Key="ListItemHighlight" Color="#FFE38E27" /> 
 
        <!-- List Item UnHighlight --> 
        <SolidColorBrush x:Key="ListItemUnHighlight" Color="#FF6FB8FD" /> 
 
        <!-- Button Gradient --> 
        <LinearGradientBrush x:Key="ButtonGradient" EndPoint="0.5,1" StartPoint="0.5,0"
            <GradientStop Color="#FF0E3D70"/> 
            <GradientStop Color="#FF001832" Offset="1"/> 
        </LinearGradientBrush> 
    </Window.Resources> 
     
     
    <Grid> 
        <Grid.Resources> 
            <Style TargetType="ToggleButton" x:Key="Expander"
                <Setter Property="IsTabStop" Value="False" /> 
                <Setter Property="Cursor" Value="Hand" /> 
                <Setter Property="Template"
                    <Setter.Value> 
                        <ControlTemplate TargetType="{x:Type ToggleButton}"
                            <ControlTemplate.Triggers> 
                                <Trigger Property="IsMouseOver" Value="True"
                                    <Trigger.EnterActions> 
                                        <BeginStoryboard> 
                                            <Storyboard> 
                                                <DoubleAnimation Duration="0:0:0.05" 
                                                        Storyboard.TargetName="Button" 
                                                        Storyboard.TargetProperty="Opacity" To="0" /> 
                                                <DoubleAnimation Duration="0:0:0.05" 
                                                        Storyboard.TargetName="ButtonOver" 
                                                        Storyboard.TargetProperty="Opacity" To="1" /> 
                                            </Storyboard> 
                                        </BeginStoryboard> 
                                    </Trigger.EnterActions> 
                                </Trigger> 
                                <Trigger Property="IsChecked" Value="True"
                                    <Trigger.EnterActions> 
                                        <BeginStoryboard> 
                                            <Storyboard> 
                                                <DoubleAnimation Duration="0:0:0.05" 
                                                        Storyboard.TargetName="CollapsedVisual" 
                                                        Storyboard.TargetProperty="Opacity" To="0" /> 
                                                <DoubleAnimation Duration="0:0:0.05" 
                                                        Storyboard.TargetName="CollapsedVisualOver" 
                                                        Storyboard.TargetProperty="Opacity" To="0" /> 
                                            </Storyboard> 
                                        </BeginStoryboard> 
                                    </Trigger.EnterActions> 
                                    <Trigger.ExitActions> 
                                        <BeginStoryboard> 
                                            <Storyboard> 
                                                <DoubleAnimation Duration="0:0:0.05" 
                                                        Storyboard.TargetName="CollapsedVisual" 
                                                        Storyboard.TargetProperty="Opacity" To="1" /> 
                                                <DoubleAnimation Duration="0:0:0.05" 
                                                        Storyboard.TargetName="CollapsedVisualOver" 
                                                        Storyboard.TargetProperty="Opacity" To="1" /> 
                                            </Storyboard> 
                                        </BeginStoryboard> 
                                    </Trigger.ExitActions> 
                                </Trigger> 
 
                            </ControlTemplate.Triggers> 
                            <Grid> 
                                <Grid x:Name="Button" Margin="0,7,4,0" HorizontalAlignment="Right" 
                                        VerticalAlignment="Top" Width="11" Height="11"
                                    <Grid.Background> 
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                            <GradientStop Color="#3F047BA5" Offset="0.996" /> 
                                            <GradientStop Color="#00000000" Offset="0" /> 
                                        </LinearGradientBrush> 
                                    </Grid.Background> 
                                    <Rectangle Stroke="#FF000000" HorizontalAlignment="Left" 
                                            VerticalAlignment="Top" Width="11" Height="11" /> 
 
                                    <Rectangle x:Name="CollapsedVisual" Fill="#FF000000" 
                                            HorizontalAlignment="Left" VerticalAlignment="Top" 
                                            Width="1" Height="5" Margin="5,3,0,0" /> 
                                    <Rectangle Fill="#FF000000" VerticalAlignment="Top" 
                                            HorizontalAlignment="Left" Height="1" Width="5" 
                                            Margin="3,5,0,0" /> 
                                </Grid> 
 
                                <Grid x:Name="ButtonOver" Margin="0,7,4,0" 
                                        HorizontalAlignment="Right" VerticalAlignment="Top" 
                                        Width="11" Height="11"
                                    <Rectangle Stroke="#FF167497" HorizontalAlignment="Left" 
                                            VerticalAlignment="Top" Width="11" Height="11"
                                        <Rectangle.Fill> 
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                                <GradientStop Color="#26167497" Offset="1" /> 
                                                <GradientStop Color="#00167497" Offset="0" /> 
                                            </LinearGradientBrush> 
                                        </Rectangle.Fill> 
                                    </Rectangle> 
                                    <Rectangle x:Name="CollapsedVisualOver" Fill="#FF167497" 
                                            HorizontalAlignment="Left" VerticalAlignment="Top" 
                                            Width="1" Height="5" Margin="5,3,0,0" /> 
                                    <Rectangle Fill="#FF167497" VerticalAlignment="Top" 
                                            HorizontalAlignment="Left" Height="1" Width="5" 
                                            Margin="3,5,0,0" /> 
 
                                </Grid> 
                            </Grid> 
 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
            
            <XmlDataProvider x:Key="MyList" Source="XML/Scenes.xml"/> 
 
            <HierarchicalDataTemplate x:Key="League" ItemsSource="{Binding XPath=Procedures/Procedure}"
                    <Border BorderBrush="#FF103C62" BorderThickness="1"  Margin="-2,0,0,-1"
                        <Grid> 
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Telerik:RadTreeView}}, Path=ActualWidth}" /> 
                            </Grid.ColumnDefinitions> 
                            <Label  
                            VerticalContentAlignment="Center" BorderThickness="0" BorderBrush="Transparent" 
                            Foreground="White" 
                            FontSize="18" 
                            Tag="{Binding XPath=@name}" 
                                    MinHeight="55" 
                            Cursor="Hand" 
                            FontFamily="Arial" 
                            FocusVisualStyle="{x:Null}" 
                            KeyboardNavigation.TabNavigation="None" 
                            Background="{StaticResource LostFocusStyle}" 
                            Name="SubItem" 
                            > 
                                <Label.ContextMenu> 
                                    <ContextMenu Name="editMenu"
                                        <MenuItem Header="Edit"/> 
                                    </ContextMenu> 
                                </Label.ContextMenu> 
                                <TextBlock Text="{Binding XPath=@name}" Margin="15,0,40,0" TextWrapping="Wrap"></TextBlock> 
                            </Label> 
                        </Grid> 
 
                    </Border> 
            </HierarchicalDataTemplate> 
    
        </Grid.Resources> 
        <Grid Width="300" Height="320" HorizontalAlignment="Center" VerticalAlignment="Center"
            <Border  BorderBrush="#FF000000" CornerRadius="5" BorderThickness="5" Background="#FFFFFFFF"
 
                <Telerik:RadTreeView 
                ExpanderStyle="{StaticResource Expander}"  
                ItemsSource="{Binding Source={StaticResource MyList}, XPath=/Scenes/Scene}" 
                ItemTemplate="{StaticResource League}" 
                     
                    /> 
            </Border> 
        </Grid> 
    </Grid> 
 
</Window> 


Ryan Black
Top achievements
Rank 1
 answered on 13 May 2010
3 answers
207 views
I know I can persist the RadDock layout to a file, but can I persist the layout to an application setting property? If so any example?

Thanks!
Miroslav Nedyalkov
Telerik team
 answered on 13 May 2010
4 answers
689 views
Can someone describe the easiest way to edit the style of the scrollbar.
I tried with Blend but it only changes background color which is not enough. I want to restyle everything, like bars and buttons, including style when clicked and dragged and hovered (Like any other style).
How can I manage this without too much work (E.q. creating a new theme).
Seems this is not in the styles in Blend???
Kalin Milanov
Telerik team
 answered on 13 May 2010
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?