public
static
class
RadSchedule
{
public
static
bool
GetEnsureVisibilityOfSelectedAppointments(DependencyObject obj)
{
return
(
bool
)obj.GetValue(EnsureVisibilityOfSelectedAppointmentsProperty);
}
public
static
void
SetEnsureVisibilityOfSelectedAppointments(DependencyObject obj,
bool
value)
{
obj.SetValue(EnsureVisibilityOfSelectedAppointmentsProperty, value);
}
public
static
readonly
DependencyProperty EnsureVisibilityOfSelectedAppointmentsProperty =
DependencyProperty.RegisterAttached(
"EnsureVisibilityOfSelectedAppointments"
,
typeof
(
bool
),
typeof
(RadSchedule),
new
UIPropertyMetadata(
false
, EnsureVisibilityChanged));
private
static
void
EnsureVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if
(d ==
null
)
{
throw
new
ArgumentNullException(
"d"
);
}
var view = d
as
RadScheduleView;
if
(view ==
null
)
{
throw
new
NotSupportedException(
"This attached behavior can only be set on a Telerik RadScheduleView."
);
}
var shouldEnsureVisibility = (
bool
)e.NewValue;
if
(shouldEnsureVisibility)
{
view.AppointmentSelectionChanged += view_AppointmentSelectionChanged;
}
else
{
view.AppointmentSelectionChanged -= view_AppointmentSelectionChanged;
}
}
static
void
view_AppointmentSelectionChanged(
object
sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
if
(sender ==
null
)
{
throw
new
ArgumentNullException(
"sender"
);
}
var view = sender
as
RadScheduleView;
if
(view ==
null
)
{
throw
new
NotSupportedException(
"This attached behavior can only be set on a Telerik RadScheduleView."
);
}
if
(view.SelectedAppointment ==
null
)
{
return
;
}
view.ScrollIntoView(view.SelectedAppointment,
true
);
// According to http://www.telerik.com/community/forums/wpf/scheduleview/scrollntoview-not-working.aspx,
// this should have solved this issue:
view.CurrentDate = view.SelectedAppointment.Start.Date;
}
}
<
UserControl.DataContext
>
<
DutyRegulations:DutyRegulationsViewModel
/>
</
UserControl.DataContext
>
<
UserControl.Resources
>
<
DataTemplate
x:Key
=
"TabContentTemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadRichTextBox
x:Name
=
"radRichTextBox"
IsReadOnly
=
"True"
Grid.Column
=
"0"
Width
=
"500"
Height
=
"500"
/>
<
Rtf:RtfDataProvider
Rtf
=
"{Binding FileSource}"
RichTextBox
=
"{Binding ElementName=radRichTextBox}"
/>
</
Grid
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
>
<
telerik:RadTabControl
HorizontalAlignment
=
"Stretch"
Name
=
"radTabControl"
VerticalAlignment
=
"Stretch"
ItemsSource
=
"{Binding Path=StaffDutyRegulations}"
DisplayMemberPath
=
"Staff.Name"
ContentTemplate
=
"{StaticResource TabContentTemplate}"
/>
</
Grid
>
Hi all
We had an application which was working on 3.5 .net framework but now we have upgraded it to framework 4 and telerik version is the same (telerik version: 2011.1.315.35) suddenly a strange issue is happening
We have a XAML file with Hirarchical grid structure (Master grid and a child grid for that).
There are two buttons in two seperate columns of the child grid both have click event and visiblity of the button is set through converter
ISSUE: the child grid is not getting displayed when i click on the expand button ie(+) of the master grid . and if i remove the click event for the buttons its working and also if keep the click event and remove the visiblity which is set through converter it works fine.
it will not work when both are used
Please Help
thanks in advance
Jagadeesh