//Part of the ViewModel - Beginprivate ObservableCollection<ProductCategoryModel> _planCollection = null;public ViewModel(){ //ViewModel Constructor _planCollection = new ObservableCollection<ProductCategoryModel> { new ProductCategoryModel("AlphaPlan"), new ProductCategoryModel("BetaPlan") }}public ObservableCollection<ProductCategoryModel> PlanCollection{ get { return _planCollection; } set { _planCollection = value; }}public ObservableCollection<CalendarWeek> AlphaPlan{ get { return _planCollection[0].Numbers; } set { throw new NotImplementedException(); }}public ObservableCollection<CalendarWeek> BetaPlan{ get { return _planCollection[1].Numbers; } set { throw new NotImplementedException(); }}//Part of the ViewModel - End//The Models - Beginpublic class CalendarWeek : INotifyPropertyChanged { public CalendarWeek(int week, float value) { this.Week = week; this.Value = value; } [Display(AutoGenerateField = false)] public int Week { get; set; } [DisplayAttribute(Name = "Value")] public double Value { get; set; } }public class ProductCategoryModel { public ProductCategoryModel(string leName) { this.Product = leName; this.Numbers = new ObservableCollection<CalendarWeek>(); for (int i = 1; i <= 52; i++) { Random r = new Random(Guid.NewGuid().GetHashCode()); int rInt = r.Next(0, 100); this.Numbers.Add(new CalendarWeek(i, rInt)); } } public ObservableCollection<CalendarWeek> Numbers { get; set; } public string Product { get; set; } }//The Models - End
<telerik:RadComboBox Name="rcbNew" Grid.Row="0"
IsEditable="True" Height="25" Width="200">
<telerik:RadComboBox.Items>
<telerik:RadComboBoxItem>
<telerik:RadComboBoxItem.Template>
<ControlTemplate>
<my1:RadGridView x:Name="RadGridView1" ShowGroupPanel="False" CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed" IsReadOnly="True"
IsFilteringAllowed="False" ItemsSource="{Binding .}"
Width="200" Height="150" SelectionChanged="RadGridView1_SelectionChanged" >
</my1:RadGridView>
</ControlTemplate>
</telerik:RadComboBoxItem.Template>
</telerik:RadComboBoxItem>
</telerik:RadComboBox.Items>
</telerik:RadComboBox>
DependencyProperty currentSelectedValue = DependencyProperty.Register("rcbNewSelectedValue", typeof(Int32), typeof(Int32));
// Constructor
public GridinDropDown()
{
InitializeComponent();
IList<Company> MyObject;
MyObject = new List<Company>()
{
new Company { Id=1, Name="Description1" },
new Company { Id=2, Name="Description2" },
new Company { Id=3, Name="Description3" },
new Company { Id=4, Name="Description4" }
};
this.DataContext = MyObject;
}
private void RadGridView1_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
{
rcbNew.Text = ((Company)((Telerik.Windows.Controls.GridView.GridViewDataControl)sender).SelectedItem).Name;
rcbNew.SetValue(currentSelectedValue, ((Company)((Telerik.Windows.Controls.GridView.GridViewDataControl)sender).SelectedItem).Id);// = ((Company)((Telerik.Windows.Controls.GridView.GridViewDataControl)sender).SelectedItem).Id;
rcbNew.IsDropDownOpen = false;
}
<telerik:RadScheduleView.ViewDefinitions>
<telerik:DayViewDefinition Title="{res:Res Static=loc:ResourceIntervention.DayPlanning, Default='Jour!'}"/>
<telerik:WeekViewDefinition Title="{res:Res Static=loc:ResourceIntervention.WeekPlanning, Default='Semaine!'}"/>
<telerik:MonthViewDefinition Title="{res:Res Static=loc:ResourceIntervention.MonthPlanning, Default='Mois!'}"/>
</telerik:RadScheduleView.ViewDefinitions>
<telerik:RadScheduleView.GroupDescriptionsSource><telerik:GroupDescriptionCollection>
<telerik:DateGroupDescription />
<telerik:ResourceGroupDescription ResourceType="Technicians" />
</telerik:GroupDescriptionCollection>
</telerik:RadScheduleView.GroupDescriptionsSource>
I would like to group data by "date" and"Technicians" only in the day view definition.
In the week view definition, I would like to group by "Date" only.
Is it possible?
Kind regards,
Sebastien
I have a ResourceDictionary xaml file that I use for centralized styling. In it I'm trying to use the style below but am getting an error:
Error 1 The type 'telerik:ThemeResourceKey' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Development\BestpassEM\WPFInfrastructure\Styles\ControlStyles.xaml 36 65 Miscellaneous Files
I have the namespace def at the top of my file (xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" ) what else would I need?
I did have this working but then had to switch my target framework from 4.0 Client Profile to the full verion of 4.0 (to support the telerik ReportViewer control). What could that have broken?
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Windows7Theme, ElementType=TextBox}}" x:Key="EditTextStyle"> <Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="Margin" Value="2" /> <Setter Property="Foreground" Value="#333333" /> <!--<Setter Property="Height" Value="22" /> <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}" />--> <Setter Property="Validation.ErrorTemplate" Value="{StaticResource validationTemplate}"/> <Style.Triggers> <Trigger Property="Validation.HasError" Value="True"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors).CurrentItem.ErrorContent}"/> </Trigger> </Style.Triggers> </Style> <telerik:RadMaskedNumericInput HorizontalAlignment="Stretch" Grid.Row="3" Grid.Column="1" Value="{Binding Port}" IsClearButtonVisible="False" IsEnabled="{Binding IsReady}" Margin="0,5,0,0" Mask="d5" AutoFillNumberGroupSeparators="False" AllowSkipPlaceholders="False" HorizontalContentAlignment="Left" SelectionOnFocus="CaretToBeginning" Placeholder=" " AutoFillZeros="False" TextMode="PlainText" InputBehavior="Insert"/>