Telerik Forums
UI for WPF Forum
1 answer
133 views
Whats up with the RadHTMLPlaceHolder Control ?

I keep finding videos that refer to it as the RadHTMLPlaceHolder Control for Silverlight and WPF but it doesnt seem to be part of WPF.
Example:
http://www.youtube.com/watch?v=2V3GBQKPQws&feature=results_main&playnext=1&list=PL26B565F9DF19A9C4

Will it be added in the future?
Using the Windows Forms HTML Webbrowser control in WPF works alright but is not designed for WPF.
Petar Mladenov
Telerik team
 answered on 14 Jun 2012
1 answer
99 views
Hi,

I would like to know if with the new release 2012.2.607.0 when we have a GridViewCheckBoxColumn in a grid, if we do some grouping, if a checkbox appear in the group header to select/unselect by a single click all the subrows of the grouped columns?

Thank's
Dimitrina
Telerik team
 answered on 13 Jun 2012
3 answers
153 views
I have these classes Task and ResourceHour
public class Task {
    public Task() {
        this.TotalHoursByResource = new List<ResourceHour>();
    }
 
    public int ID {get;set;}
    public string Name { get; set; }
    public decimal TotalHours { get; set; }
    public List<ResourceHour> TotalHoursByResource { get; set; }
}
 
public class ResourceHour {
    public string Resource { get; set; }
    public string WorkingHourType { get; set; }
    public double Hours { get; set; }
}

A list of Task objects is bound to a RadGridView and I want to create a custom aggregate on Property "TotalHoursByResource" which is a list of ResourceHour objects.

When i try to do it as below, it gives an error
No generic method '' on type '' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.

public class HoursAggregate : EnumerableSelectorAggregateFunction {
    protected override string AggregateMethodName {
        get { return "GetAggregateHours"; }
    }
    protected override Type ExtensionMethodsType {
        get { return typeof(HoursAggregateType); }
    }
 
}
 
public static class HoursAggregateType {
    public static string GetAggregateHours<T>(IEnumerable<Task> source, Func<Task, List<ResourceHour>> selector) where T : Task {
        return "Some string from TotalHoursByResource";
    }
}


Any ideas if I can create a custom aggregate function to run on a property which itself is a list??
Dimitrina
Telerik team
 answered on 13 Jun 2012
4 answers
316 views
I have a couple of Masked Input controls on my form, including one date time and a couple of numeric input.  I have buttons tied to the controls through events which increase or decrease the value of the control by 1.  The values of these controls are bound to variables in my program.  Here's the Xaml:

<UserControl x:Class="CarSystem.CustomControls.TimeSpanSpinner"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:cs="clr-namespace:CarSystem.CustomControls"
             mc:Ignorable="d"
             Focusable="True"
             Loaded="UserControl_Loaded">
  
    <UserControl.Resources>
        <cs:TimeSpanToDateTimeConverter x:Key="TimeSpanConverter" />
    </UserControl.Resources>
  
    <Grid Background="{Binding Path=GridBackground, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
          Width="{Binding Path=Width, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <telerik:RadMaskedDateTimeInput BorderBrush="{Binding Path=BorderBrush, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FlowDirection="{Binding Path=FlowDirection, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        Focusable="True"
                                        FontFamily="{Binding Path=FontFamily, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontSize="{Binding Path=FontSize, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontStretch="{Binding Path=FontStretch, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontStyle="{Binding Path=FontStyle, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        FontWeight="{Binding Path=FontWeight, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        GotFocus="ValueBox_GotFocus"
                                        Grid.Column="0"
                                        HorizontalAlignment="Stretch"
                                        HorizontalContentAlignment="Right"
                                        InputBehavior="Insert"
                                        IsClearButtonVisible="False"
                                        LostFocus="ValueBox_LostFocus"
                                        Margin="5"
                                        Mask="{Binding Path=Mask, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        Name="ValueBox"
                                        SelectionOnFocus="CaretToEnd"
                                        SpinMode="PositionAndValue"
                                        TabIndex="{Binding Path=TabIndex, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                        TextMode="MaskedText"
                                        UpdateValueEvent="PropertyChanged"
                                        Value="{Binding Path=Value, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}, Converter={StaticResource TimeSpanConverter}}"
                                        VerticalAlignment="Center" />
        <RepeatButton Background="{DynamicResource ButtonBackground}"
                      Click="IncrementButton_Click"
                      Focusable="False"
                      Foreground="{DynamicResource ButtonForeground}"
                      Grid.Column="1"
                      IsTabStop="False"
                      Name="IncrementButton">
            <Image>
                <Image.Style>
                    <Style TargetType="{x:Type Image}">
                        <Setter Property="Source"
                                Value="/CustomControls;component/Resources/VolumeUpDay.png" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=TimeOfDayMode, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                         Value="NightTime">
                                <Setter Property="Source"
                                        Value="/CustomControls;component/Resources/VolumeUpNight.png" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </RepeatButton>
        <RepeatButton Background="{DynamicResource ButtonBackground}"
                      Click="DecrementButton_Click"
                      Focusable="False"
                      Foreground="{DynamicResource ButtonForeground}"
                      Grid.Column="2"
                      IsTabStop="False"
                      Name="DecrementButton">
            <Image>
                <Image.Style>
                    <Style TargetType="{x:Type Image}">
                        <Setter Property="Source"
                                Value="/CustomControls;component/Resources/VolumeDnDay.png" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=TimeOfDayMode, RelativeSource={RelativeSource AncestorType={x:Type cs:TimeSpanSpinner}}}"
                                         Value="NightTime">
                                <Setter Property="Source"
                                        Value="/CustomControls;component/Resources/VolumeDnNight.png" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </RepeatButton>
    </Grid>
</UserControl>

And here's the code-behind:

    public partial class TimeSpanSpinner : UserControl {
  
        public static readonly DependencyProperty FocusedBackgroundProperty =
            DependencyProperty.Register( "FocusedBackground", typeof( Brush ), typeof( TimeSpanSpinner ), new PropertyMetadata( null ) );
  
        public static readonly DependencyProperty FocusedForegroundProperty =
            DependencyProperty.Register( "FocusedForeground", typeof( Brush ), typeof( TimeSpanSpinner ), new PropertyMetadata( null ) );
  
        public static DependencyProperty GridBackgroundProperty =
            DependencyProperty.Register( "GridBackground", typeof( Brush ), typeof( TimeSpanSpinner ), new PropertyMetadata( Brushes.Transparent ) );
  
        public static readonly DependencyProperty MaskProperty = 
            DependencyProperty.Register( "Mask", typeof( string ), typeof( TimeSpanSpinner ), new PropertyMetadata( "HH:mm:ss.fff" ) );
  
        public static readonly DependencyProperty TimeOfDayModeProperty =
            DependencyProperty.Register( "TimeOfDayMode", typeof( TimesOfDay ), typeof( TimeSpanSpinner ),
                                         new FrameworkPropertyMetadata( TimesOfDay.DayTime,
                                             FrameworkPropertyMetadataOptions.AffectsRender,
                                             new PropertyChangedCallback( OnTimeOfDayInvalidated ) ) );
  
        public static readonly DependencyProperty UnfocusedBackgroundProperty =
            DependencyProperty.Register( "UnfocusedBackground", typeof( Brush ), typeof( TimeSpanSpinner ), new PropertyMetadata( null ) );
  
        public static readonly DependencyProperty UnfocusedForegroundProperty =
            DependencyProperty.Register( "UnfocusedForeground", typeof( Brush ), typeof( TimeSpanSpinner ), new PropertyMetadata( null ) );
  
        public static readonly DependencyProperty ValueProperty = 
            DependencyProperty.Register( "Value", typeof( TimeSpan ), typeof( TimeSpanSpinner ), new PropertyMetadata( TimeSpan.Zero ) );
  
        public Brush FocusedBackground {
            get { return (Brush) GetValue( FocusedBackgroundProperty ); }
            set { SetValue( FocusedBackgroundProperty, value ); }
        }
  
        public Brush FocusedForeground {
            get { return (Brush) GetValue( FocusedForegroundProperty ); }
            set { SetValue( FocusedForegroundProperty, value ); }
        }
  
        public Brush GridBackground {
            get { return (Brush) GetValue( GridBackgroundProperty ); }
            set { SetValue( GridBackgroundProperty, value ); }
        }
  
        public string Mask {
            get { return (string) GetValue( MaskProperty ); }
            set { SetValue( MaskProperty, value ); }
        }
  
        public TimesOfDay TimeOfDayMode {
            get { return (TimesOfDay) GetValue( TimeOfDayModeProperty ); }
            set { SetValue( TimeOfDayModeProperty, value ); }
        }
  
        public Brush UnfocusedBackground {
            get { return (Brush) GetValue( UnfocusedBackgroundProperty ); }
            set { SetValue( UnfocusedBackgroundProperty, value ); }
        }
  
        public Brush UnfocusedForeground {
            get { return (Brush) GetValue( UnfocusedForegroundProperty ); }
            set { SetValue( UnfocusedForegroundProperty, value ); }
        }
  
        public TimeSpan Value {
            get { return (TimeSpan) GetValue( ValueProperty ); }
            set { SetValue( ValueProperty, value ); }
        }
  
        public TimeSpanSpinner() {
            InitializeComponent();
        }
  
        private void DecrementButton_Click( object sender, RoutedEventArgs e ) {
            // Decrement the Value in the ValueBox
            ValueBox.CallSpin( false );
        }
  
        private void IncrementButton_Click( object sender, RoutedEventArgs e ) {
            ValueBox.CallSpin( true );
        }
  
        private void OnTimeOfDayModeChanged( TimesOfDay newTimeofDayMode ) {
            if ( FocusedBackground != null && UnfocusedBackground != null ) {
                ValueBox.Background = ValueBox.IsFocused ? FocusedBackground : UnfocusedBackground;
            }
  
            if ( FocusedForeground != null && UnfocusedForeground != null ) {
                ValueBox.Foreground = ValueBox.IsFocused ? FocusedForeground : UnfocusedForeground;
            }
        }
  
        private static void OnTimeOfDayInvalidated( DependencyObject d, DependencyPropertyChangedEventArgs e ) {
            TimeSpanSpinner spinner = (TimeSpanSpinner) d;
  
            spinner.OnTimeOfDayModeChanged( (TimesOfDay) e.NewValue );
        }
  
        private void UserControl_Loaded( object sender, RoutedEventArgs e ) {
            if ( FocusedBackground == null && UnfocusedBackground == null ) {
                ValueBox.Background = Background;
            }
  
            if ( FocusedForeground == null && UnfocusedForeground == null ) {
                ValueBox.Foreground = Foreground;
            }
        }
  
        private void ValueBox_GotFocus( object sender, RoutedEventArgs e ) {
            if ( FocusedBackground != null ) {
                ValueBox.Background = FocusedBackground;
            }
  
            if ( FocusedForeground != null ) {
                ValueBox.Foreground = FocusedForeground;
            }
        }
  
        private void ValueBox_LostFocus( object sender, RoutedEventArgs e ) {
            if ( UnfocusedBackground != null ) {
                ValueBox.Background = UnfocusedBackground;
            }
  
            if ( UnfocusedForeground != null ) {
                ValueBox.Foreground = UnfocusedForeground;
            }
        }
    }
}


I want users to be able to change the value of the controls by editing them and have the value of the control change, so that if they make an edit, then hit the up or down arrow buttons, the value increments from the value they edited, not where the value was before they edited the field.

What do I need to change to make this work?

Tony
Tony
Top achievements
Rank 1
 answered on 13 Jun 2012
0 answers
65 views
See other post with same title.
Steve
Top achievements
Rank 1
 asked on 13 Jun 2012
1 answer
216 views

 Hi, 
    I have a RadGridView bind to a datatable and sort by Name column. My problem is after I modify the Name column, the RadGridView performs a 'auto sort' and the current selected row is deselected and the SelectedItem is Nothing.

    How can I preserve the selected row after the 'auto sort'?

Thanks,
Chris



<
telerik:RadGridView  DockPanel.Dock="Top" x:Name="gv"  SelectionMode="Single" RowHeight="30"
                                                IsSynchronizedWithCurrentItem="True" AutoGenerateColumns="False" ShowGroupPanel="False" >
                              <telerik:RadGridView.Columns>
                                  <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Name}" Header="Name" UniqueName="Name" />
                                  <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=PhoneNumber}"  Header="Phone Number" />
                                  <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=City}" Header="City"  />
                                  <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=State}" Header="State"  />                                </telerik:RadGridView.Columns>
                                  <telerik:RadGridView.SortDescriptors>
                                      <telerik:ColumnSortDescriptor  Column="{Binding Columns[\Name\], ElementName=gv}"
                                             SortDirection="Ascending" />
                                  </telerik:RadGridView.SortDescriptors>
 
                              </telerik:RadGridView>
Dimitrina
Telerik team
 answered on 13 Jun 2012
1 answer
111 views
I want to set the SelectedItem Propertie without a click on Rotate.

just rotate over Scrollbar or Mousewheel and the viewed item is selected.

(SelectedItem  = Current Viewed Item)
Is it possible ?

Thank in advance
Maya
Telerik team
 answered on 13 Jun 2012
3 answers
130 views
hello, 
I'm using with chart with type of Pie, and the lables displayed one over the other..
How could i fix it?
My code is attached... thanks.
Rosko
Telerik team
 answered on 13 Jun 2012
1 answer
178 views
Hi all
in the current q1 sp1, RadPanes are inside the docking if docking has a smaller width. this was not a problem in the previous q1 release. please use the following code to generate the error.  I am also attaching the screen shot.
<Window x:Class="RadControlsWpfApp3.MainWindow"
                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"
                Title="MainWindow" Height="350" Width="525">
        <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
            <telerik:RadDocking AllowUnsafeMode="True" >
            <telerik:RadSplitContainer Orientation="Vertical">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="1" IsPinned="False"></telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="2" IsPinned="False"></telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Window>

Georgi
Telerik team
 answered on 13 Jun 2012
1 answer
96 views
Is there a way to apply the RadContextMenu to all TextBox controls without having to attach to each one individually?
Thanks in advance,
Steve
Yana
Telerik team
 answered on 13 Jun 2012
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
Book
FileDialogs
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?