Telerik Forums
UI for WPF Forum
4 answers
157 views
I'm new to WPF and to the Carousel as well, but taking what little examples there are for this control just isn't working for me. Even taking the exact code from your documentation and applying it makes my Carousel disappear.

When trying to view the Style in Expression Blend 4, I get an error "Property values set when no trigger is active". 

The code I have is very simple:

<telerik:RadCarousel x:Name="carousel"
            <Image Source="Images/Puck/1.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/4.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/5.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/6.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/7.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/9.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/10.jpg" Width="200" Height="200" Stretch="Fill" /> 
            <Image Source="Images/Puck/11.jpg" Width="200" Height="200" Stretch="Fill" /> 
        </telerik:RadCarousel> 
        <Grid.Resources> 
            <Style TargetType="{x:Type telerik:CarouselItem}"
                <Setter Property="Template"
                    <Setter.Value> 
                        <ControlTemplate TargetType="{x:Type telerik:CarouselItem}"
                            <Border x:Name="border"
                                <VisualStateManager.VisualStateGroups> 
                                    <VisualStateGroup x:Name="ValidationStates"
                                        <VisualState x:Name="Valid"/> 
                                        <VisualState x:Name="InvalidFocused"/> 
                                        <VisualState x:Name="InvalidUnfocused"/> 
                                    </VisualStateGroup> 
                                </VisualStateManager.VisualStateGroups> 
                                <Border x:Name="CarouselItemMainBorder" 
                                    ClipToBounds="False" RenderTransformOrigin="0.5, 1" 
                                    Opacity="{Binding ReflectionSettings.Opacity, RelativeSource={RelativeSource TemplatedParent}}" 
                                    Visibility="{Binding ReflectionSettings.Visibility, RelativeSource={RelativeSource TemplatedParent}}" 
                                    BorderBrush="{x:Null}" BorderThickness="1,1,1,1" CornerRadius="0" SnapsToDevicePixels="True" Margin="0,0,-10,-35" MouseEnter="MouseEnterTest"
                                    <Border.Background> 
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                            <GradientStop Color="#FFC1DCFF" Offset="0"/> 
                                            <GradientStop Color="#FF7EB8F8" Offset="1"/> 
                                        </LinearGradientBrush> 
                                    </Border.Background> 
                                </Border> 
                            </Border> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
        </Grid.Resources> 

x
Top achievements
Rank 1
 answered on 10 Jul 2010
5 answers
308 views
I followed this link http://www.telerik.com/help/wpf/radtabcontrol-populating-binding-to-collection.html to bind a collection to my tab control. The content is displaying properly but the header is not. My header is still displaying "MiddleLayer.SalesPerson" even though I assigned "Name" to DisplayMemberpath. My code is as below

    <UserControl.Resources>
        <DataTemplate x:Key="salesTemplate">
            <ctrls:AccountSalesPersonUserControl DataContext="{Binding}"></ctrls:AccountSalesPersonUserControl>
        </DataTemplate>
    </UserControl.Resources>

 <telerikPresent:RadTabControl x:Name="SalesPersonTab" ItemsSource="{Binding Path=SelectedItem.SalesPersons, Mode=OneWay}"
                   DisplayMemberPath="Name" ContentTemplate="{StaticResource salesTemplate}" />




Alex Wu
Top achievements
Rank 1
 answered on 10 Jul 2010
2 answers
457 views
Hello All,

We are in the process of converting the plain old WPF TabControl with the RadTabControl.  We have a need to get the last tab that was selected before the user clicked a new tab.

Using the WPF TabControl, in the EventArgs, there was an AddedItems and RemovedItems property.  In the RadTabControl, these do not exist.

Is there a way to get the user's last selected TabItem using this handler?

Thanks,
Chris
Chris Andrews
Top achievements
Rank 1
 answered on 09 Jul 2010
7 answers
265 views
Hello everybody

After doing researches in all available source I still can not accomplish this probably trivial task. I would like to read the values of various cells of the row which is selected. The sample I found in this forum deals with a business object (Person). I'd expected something like:

myValue = gridview.selectedRow.Columns("NameOfThisColumn")

Thanks for your help in advance

Michael Lutz
BITsoft
Vlad
Telerik team
 answered on 09 Jul 2010
7 answers
234 views
Hello Everybody

I would like to be able to create custom groupings that allow users to group by a range of values rather than by a specific value of a particular member.  For example, if there is a "severity" column that has integer values from 0-199, I'd like to be able to create 2 groups of severity 0-99 and 100-199 instead of the default of 200 groups, one for severity 1, one for severity 2, etc.

I've hunted through the docs and it looks like I may be able to extend from Telerik.Windows.Data.GroupDescriptor to achieve my goal, but the documentation on the subject is not very helpful.  Can anyone explain how the GroupDescriptor class creates a grouping, or even better, provide code examples of how its done?

Thanks,
Tom
Pavel Pavlov
Telerik team
 answered on 09 Jul 2010
3 answers
662 views
Hello,

How can I get the location (latitude and longitude coordinates) for the point beneath the mouse cursor?

Thank you.
Andrey
Telerik team
 answered on 09 Jul 2010
3 answers
139 views
Hi,

I'm testing out this library and I'm getting the following error:
No method 'Average' on type 'System.Linq.Enumerable' is compatible with the supplied arguments.

I'm doing a very simple test. Here is the relevant code:

public class Data     
{     
    public UInt32 XValue { getset; }     
    public double YValue { getset; }     
}     
    
List<Data> m_Data; // This is initialized with data.     
    
// Then, when setting up the chart...     
    
SeriesMapping seriesMapping = new SeriesMapping();     
LineSeriesDefinition lineDefinition = new LineSeriesDefinition();     
lineDefinition.ShowItemLabels = false;     
seriesMapping.SeriesDefinition = lineDefinition;     
seriesMapping.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));  
seriesMapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));     
MyChart.SeriesMappings.Add(seriesMapping);     
    
// Then I set my data     
MyChart.ItemSource = m_Data; 

When m_Data has more then 397 elements it throws that error. Before that number it looks pretty.

Any help will be greatly appreciated.
- Luis
Ves
Telerik team
 answered on 09 Jul 2010
3 answers
156 views
Is it possible to show a value that is not part of the ItemsSource of the combobox? My observablecollection contains 1,2,3,4, but the value I have assigned to the databound field is 10.

Below is my current column setup.
<telerik:GridViewComboBoxColumn Header="Weld ID" x:Name="ddWeldID" DataMemberBinding="{Binding WeldID}" DisplayMemberPath="WeldID" SelectedValueMemberPath="WeldID" 
                                                    IsComboBoxEditable="True" /> 


WeldID contains the value 24, but the ItemsSource I bind to the combobox contains the values 1,2,3,4. When I load the grid, 24 is not displayed in the column, but if I add the value 24 as one of the dropdown options, it gets displayed in the column.

Any help would be much appreciated!

Ryan
Pavel Pavlov
Telerik team
 answered on 09 Jul 2010
2 answers
139 views
Hi,

Instead of the more usual technical question, this post is related to functional requirements, and choosing among different implementations. I hope I can keep it as short as possible, not too philosophical, and of course, raise interest/curiosity among some of you ;-)

We are currently building a Framework in order to ease and speed up the development of certain kind of applications. We have decided to create a custom control library (using telerik as base) that must fulfill the following requirementes:

1.- Provide just the properties/events (Controls) that we consider necessary. --hiding attributes--
2.- Extend the base controls in order to add extra functionallity. --creating new attributes--
3.- Ease the implementation of our interfaces. By dragging a control from the VisualStudio (or Blend) designer toolbox to the window/page/usercontrol/etc, the developer will have most of the necessary attributes (see req. 1) with the proper default values.
4.- The controls must support all the standard (graphic) features of WPF: Styling, Control Templates, Storyboards, etc.
5.- The controls must support standard event handling, although we might use a fancier action/commanding approach (like the ones implemented by Prism, or Caliburn)
6.- DataBindings.

After some research, we came up with three solutions (summarized, as I'm trying to keep this as short as possible):

A) Wrapping the control: using Control as base class, we add the telerik control as the first (and only) visual child. Then we create a DependencyProperty for each DP we want to expose from the telerik control.
public class MyComboBox : MyBaseControl  
{  
    static MyComboBox()  
    {  
        DefaultStyleKeyProperty.OverrideMetadata(typeof(MyComboBox), new FrameworkPropertyMetadata(typeof(MyComboBox)));  
  
        RegisterDependencyProperties(typeof(MyComboBox), typeof(RadComboBox));  
    }  
  
    public MyComboBox()  
    {  
        InternalFrameworkElement = new RadButton();  
  
        this.AddVisualChild(InternalFrameworkElement);  
    }  
    protected override int VisualChildrenCount  
    {  
        get  
        {  
            return InternalFrameworkElement == null ? 0 : 1;  
        }  
    }  
    protected override Visual GetVisualChild(int index)  
    {  
        if (InternalFrameworkElement == null)  
        {  
            throw new ArgumentOutOfRangeException();  
        }  
        return InternalFrameworkElement;  
    }  
    private RadComboBox ComboBox  
    {  
        get  
        {  
            return InternalFrameworkElement as RadComboBox;  
        }  
    }  
    public IEnumerable ItemsSource  
    {  
        get { return (IEnumerable)GetValue(ItemsSourceProperty); }  
        set { SetValue(ItemsSourceProperty, value); }  
    }  
  
    public static readonly DependencyProperty ItemsSourceProperty =  
        DependencyProperty.Register(  
            "ItemsSource"typeof(IEnumerable), typeof(MyComboBox),  
            new FrameworkPropertyMetadata  
            {  
                PropertyChangedCallback = (obj, e) =>  
                {  
                    (obj as MyComboBox).UpdateItemsSource((IEnumerable)e.NewValue);  
                }  
            });  
  
    private void UpdateItemsSource(IEnumerable sel)  
    {  
        ComboBox.ItemsSource = sel;  
    }  
}  
 
(its much more elaborated, and I didn't copy all the code, but you get the basic idea)

B) Control templating: using Control as base class, we redefine the default styles of each control. The template (ControlTemplate) property is assigned to the telerik control. Then we create a TemplateBinding (or complete Binding, depends...) for each DP we want to expose. The DP is also created in the Control:
<Setter Property="Template">  
    <Setter.Value>  
        <ControlTemplate TargetType="{x:Type local:MyComboBox}">  
            <ControlsInput:RadComboBox Name="PART_MyComboBox"  
                BorderBrush="{TemplateBinding Property=BorderBrush}"  
                BorderThickness="{TemplateBinding Property=BorderThickness}"  
                Background="{TemplateBinding Property=Background}"  
                Foreground="{TemplateBinding Property=Foreground}"  
                SelectionBoxTemplate="{TemplateBinding Property=SelectionBoxTemplate}"  
                ItemTemplate="{TemplateBinding Property=ItemTemplate}"  
                SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor,   
                AncestorType={x:Type local:MyComboBox}}, Path=SelectedItem}"  
                ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,   
                AncestorType={x:Type local:MyComboBox}}, Path=ItemsSource}">  
            </ControlsInput:RadComboBox>  
        </ControlTemplate>  
    </Setter.Value>  
</Setter>  
(again, its much more elaborated)

C) Directly inheriting the telerik control. (we loose the req. 1, hiding attributes)

public class MyComboBox : RadComboBox  
{  
    static MyComboBox()  
    {  
        DefaultStyleKeyProperty.OverrideMetadata(typeof(MyComboBox), new FrameworkPropertyMetadata(typeof(MyComboBox)));  
    }  
}  


In summary:
- Solution A (wrapper) is somehow ugly, and uses a lot of tricks in order to do things such as:
    - Creating data bindings (from XAML)
    - Using CustomTemplates (from the final developer point of view)
    - Create data bindings from code behind.

- Solution B is more elegant (they are pretty much the same thing, as they generate the same logical tree for each control), but I'm not sure how difficult it will be to wrap complex controls, such as the GridView, Ribbon, etc.

- Solution C basically breaks with one of the initial requirements, but its still a valid approach. Besides, you can somehow suggest what properties to use by implementing the Extensibility Model for the WPF Designer.

My questions are:

    * What is the best approach, given the scenario I exposed?
    * Any other ideas/suggestions?


By the way, we need to provide the same control libraries for Silverlight and ASP.net, and it would be nice to use the same approach, at least with WPF and SL.

Thanks,


--
R.
Roberto
Top achievements
Rank 1
 answered on 09 Jul 2010
1 answer
110 views
I am using a GridView with RowDetails.
I have a GridViewSelectcolumn.
Now whenever I select a row( check the checkbox) the rowdetails is expanded.
I do not want the row details to expand when the checkbox is checked. It should only expand/collapse through GridViewToggleRowDetailsColumn +/-

How to achieve such functionality>
Milan
Telerik team
 answered on 09 Jul 2010
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?