Hello
We are developing WPF aplication with telerik controls ver.2010.1.603
Now we bought licence for your controls ver 2010.2.0812.
And application stopped to work properly.
Here is code causes problem.
Here is our control, that is binded to two DateTime Objects. With ver. 2010.1.603
it was working fine, but with new one we have null exception, when we want to get
MarketDepthFrom, or MarketDepthTo
Please help me if you know the answer
we have 2 days left to deadline so it is
quite urgent
Regards
Michal
We are developing WPF aplication with telerik controls ver.2010.1.603
Now we bought licence for your controls ver 2010.2.0812.
And application stopped to work properly.
Here is code causes problem.
Here is our control, that is binded to two DateTime Objects. With ver. 2010.1.603
it was working fine, but with new one we have null exception, when we want to get
MarketDepthFrom, or MarketDepthTo
<
controls:PeriodControl
From
=
"{Binding Path=MarketDepthFrom, Mode=TwoWay}"
To
=
"{Binding Path=MarketDepthTo, Mode=TwoWay}"
/>
Here is XAML of our control:
<
UserControl
x:Class
=
"LT.Desk.Controls.PeriodControl"
xmlns:trans
=
"clr-namespace:LT.Language;assembly=LT.Language"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikRibbonBar
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonBar"
xmlns:telerikNavigation
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
xmlns:telerikInput
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Grid
Name
=
"PeriodGroup"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
TextBlock
Text
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Period]}"
Grid.Row
=
"0"
Grid.Column
=
"0"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Left"
Margin
=
"2,0,2,0"
/>
<
telerik:RadComboBox
HorizontalAlignment
=
"Stretch"
x:Name
=
"PeriodTypeCombo"
Margin
=
"3,0,0,0"
Grid.Row
=
"0"
Grid.Column
=
"1"
Height
=
"15"
Width
=
"100"
SelectionChanged
=
"PeriodTypeCombo_SelectionChanged"
>
<
telerik:RadComboBoxItem
Content
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Day]}"
/>
<
telerik:RadComboBoxItem
Content
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Week]}"
/>
<
telerik:RadComboBoxItem
Content
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Month]}"
/>
<
telerik:RadComboBoxItem
Content
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Quarter]}"
/>
<
telerik:RadComboBoxItem
Content
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Year]}"
/>
</
telerik:RadComboBox
>
<
TextBlock
Text
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[From]}"
Grid.Row
=
"1"
Grid.Column
=
"0"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Left"
Margin
=
"2,0,6,0"
/>
<
telerik:RadDatePicker
Grid.Row
=
"1"
Grid.Column
=
"1"
HorizontalAlignment
=
"Right"
Width
=
"100"
Name
=
"fromDP"
SelectionChanged
=
"fromDP_SelectionChanged"
/>
<
TextBlock
Text
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[To]}"
Grid.Row
=
"2"
Grid.Column
=
"0"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Left"
Margin
=
"2,0,6,0"
/>
<
telerik:RadDatePicker
Grid.Row
=
"2"
Grid.Column
=
"1"
HorizontalAlignment
=
"Right"
Width
=
"100"
Name
=
"toDP"
SelectionChanged
=
"toDP_SelectionChanged"
IsReadOnly
=
"False"
IsEnabled
=
"True"
/>
</
Grid
>
<
Grid
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerikRibbonBar:Separator
Width
=
"2"
/>
<
telerikRibbonBar:RadRibbonButton
Size
=
"Large"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
x:Name
=
"Previous"
Click
=
"Prevoius_Click"
>
<
StackPanel
Name
=
"PreviousButton"
Orientation
=
"Vertical"
>
<
Image
VerticalAlignment
=
"Top"
Height
=
"38"
Source
=
"/LT.Desk;component/Resources/back-icon32.png"
/>
<
TextBlock
VerticalAlignment
=
"Top"
FontSize
=
"12"
HorizontalAlignment
=
"Center"
Margin
=
"0,6,0,0"
Text
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Previous]}"
/>
</
StackPanel
>
</
telerikRibbonBar:RadRibbonButton
>
<
telerikRibbonBar:Separator
Width
=
"1"
/>
<
telerikRibbonBar:RadRibbonButton
Size
=
"Large"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
x:Name
=
"Next"
Click
=
"Next_Click"
>
<
StackPanel
Name
=
"NextButton"
Orientation
=
"Vertical"
>
<
Image
VerticalAlignment
=
"Top"
Height
=
"38"
HorizontalAlignment
=
"Right"
Source
=
"/LT.Desk;component/Resources/next-icon32.png"
/>
<
TextBlock
VerticalAlignment
=
"Top"
FontSize
=
"12"
HorizontalAlignment
=
"Center"
Margin
=
"0,6,0,0"
Text
=
"{Binding Source={x:Static trans:LanguageManager.Instance}, Path=Dict[Next]}"
/>
</
StackPanel
>
</
telerikRibbonBar:RadRibbonButton
>
<
telerikRibbonBar:Separator
Width
=
"2"
/>
</
StackPanel
>
</
Grid
>
</
StackPanel
>
</
UserControl
>
####################################################
And here is code behind for it:
public partial class PeriodControl
{
public DateTime? From
{
get { return (DateTime)GetValue(FromProperty); }
set { SetValue(FromProperty,value); }
}
public DateTime? To
{
get { return (DateTime)GetValue(ToProperty); }
set { SetValue(ToProperty, value); }
}
public PeriodTypeEnum PeriodType
{
get { return (PeriodTypeEnum)GetValue(PeriodTypeProperty); }
set { SetValue(PeriodTypeProperty, value); }
}
public static DependencyProperty FromProperty = DependencyProperty.Register("From", typeof(DateTime?), typeof(PeriodControl));
public static DependencyProperty ToProperty = DependencyProperty.Register("To", typeof(DateTime?), typeof(PeriodControl));
public static DependencyProperty PeriodTypeProperty = DependencyProperty.Register("PeriodType", typeof(PeriodTypeEnum), typeof(PeriodControl));
public PeriodControl()
{
InitializeComponent();
fromDP.SelectedDate =
DateTime.Today;
toDP.SelectedDate = DateTime.Today;
From = DateTime.Today;
To = DateTime.Today;
PeriodTypeCombo.SelectedIndex = 0;
}
private void fromDP_SelectionChanged(object sender, SelectionChangedEventArgs e)............
private void toDP_SelectionChanged(object sender, SelectionChangedEventArgs e).............
private void Next_Click(object sender, RoutedEventArgs e).................
private void PeriodTypeCombo_SelectionChanged(object sender, SelectionChangedEventArgs e).............
}
Please help me if you know the answer
we have 2 days left to deadline so it is
quite urgent
Regards
Michal