or
Hello,
I have a problem with the tileview control.
I have a tileview in my page with RadFluidContentControl to have different view depends on the size :
<
telerik:RadTileView
IsItemsAnimationEnabled
=
"False"
>
<
telerik:RadTileViewItem
>
<
telerik:RadFluidContentControl
TransitionDuration
=
"0"
State
=
"Large"
SmallToNormalThreshold
=
"400 400"
NormalToSmallThreshold
=
"400 400"
NormalToLargeThreshold
=
"600 600"
LargeToNormalThreshold
=
"600 600"
>
<
telerik:RadFluidContentControl.SmallContent
>
<
StackPanel
x:Name
=
"SmallContent"
>
<
TextBlock
Text
=
"Small"
/>
<
TextBlock
Text
=
"{Binding MyList.Count}"
/>
<
ListBox
ItemsSource
=
"{Binding MyList, Mode=TwoWay}"
/>
</
StackPanel
>
</
telerik:RadFluidContentControl.SmallContent
>
<
telerik:RadFluidContentControl.Content
>
<
StackPanel
x:Name
=
"Content"
>
<
TextBlock
Text
=
"Normal"
/>
<
TextBlock
Text
=
"{Binding MyList.Count}"
/>
<
ListBox
ItemsSource
=
"{Binding MyList, Mode=TwoWay}"
/>
</
StackPanel
>
</
telerik:RadFluidContentControl.Content
>
<
telerik:RadFluidContentControl.LargeContent
>
<
StackPanel
x:Name
=
"LargeContent"
>
<
TextBlock
Text
=
"Large"
/>
<
TextBlock
Text
=
"{Binding MyList.Count}"
/>
<
ListBox
ItemsSource
=
"{Binding MyList, Mode=TwoWay}"
/>
</
StackPanel
>
</
telerik:RadFluidContentControl.LargeContent
>
</
telerik:RadFluidContentControl
>
</
telerik:RadTileViewItem
>
</
telerik:RadTileView
>
MyList is just a List of String with 2 elements.
When I ran the application, only the listbox in the normal content displayed the 2 elements. In the small and large content the list was empty.
But in all contents (small, normal and large) the textblock displayed the correct number of elements in my list (2).
Do I something wrong ?
Thanks in advance for your answer.
Regards,
Patrick
<
Style
x:Key
=
"DataFooter"
TargetType
=
"GridView:GridViewFooterCell"
>
<
Setter
Property
=
"Content"
>
<
Setter.Value
>
<
StackPanel
>
<
GridView:AggregateResultsList
ItemsSource
=
"{Binding}"
VerticalAlignment
=
"Center"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
VerticalAlignment
=
"Center"
>
<
TextBlock
VerticalAlignment
=
"Center"
Text
=
"{Binding Caption}"
/>
<
TextBlock
VerticalAlignment
=
"Center"
Text
=
"{Binding FormattedValue}"
/>
</
StackPanel
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
<
ItemsControl.ItemsPanel
>
<
ItemsPanelTemplate
>
<
StackPanel
Orientation
=
"Vertical"
/>
</
ItemsPanelTemplate
>
</
ItemsControl.ItemsPanel
>
</
GridView:AggregateResultsList
>
</
StackPanel
>
</
Setter.Value
>
</
Setter
>
</
Style
>
public
class
Address
{
String _Street;
String _City;
String _Town;
String _County;
String _PostCode;
public
String Street
{
get
{
return
this
._Street;
}
set
{
this
._Street = value;
NotifyPropertyChanged(() => Street);
}
}
public
String City
{
get
{
return
this
._City;
}
set
{
this
._City = value;
NotifyPropertyChanged(() => City);
}
}
public
String Town
{
get
{
return
this
._Town;
}
set
{
this
._Town = value;
NotifyPropertyChanged(() => Town);
}
}
public
String County
{
get
{
return
this
._County;
}
set
{
this
._County = value;
NotifyPropertyChanged(() => County);
}
}
public
String PostCode
{
get
{
return
this
._PostCode;
}
set
{
this
._PostCode = value;
NotifyPropertyChanged(() => PostCode);
}
}
public
Address()
{
}
public
Address(String street, String city, String town, String county, String postCode)
{
this
.Street = street;
this
.City = city;
this
.Town = town;
this
.County = county;
this
.PostCode = postCode;
}
#region PropertyNotify
[field: NonSerializedAttribute()]
public
event
PropertyChangedEventHandler PropertyChanged =
delegate
{ };
public
readonly
Action<Action> _synchronousInvoker;
public
Address(Action<Action> synchronousInvoker)
{
_synchronousInvoker = synchronousInvoker;
}
public
void
NotifyPropertyChanged<T>(Expression<Func<T>> expr)
{
var body = expr.Body
as
MemberExpression;
if
(body !=
null
)
{
try
{
if
(_synchronousInvoker !=
null
)
_synchronousInvoker(() => InvokePropertyChanged(expr));
else
InvokePropertyChanged(expr);
}
catch
(Exception Ex)
{
if
(Ex.Message ==
"Invoke or BeginInvoke cannot be called on a control until the window handle has been created."
)
{
InvokePropertyChanged(expr);
}
}
}
}
private
void
InvokePropertyChanged<T>(Expression<Func<T>> expr)
{
var body = expr.Body
as
MemberExpression;
if
(body !=
null
)
{
if
(PropertyChanged !=
null
)
{
PropertyChanged(
this
,
new
PropertyChangedEventArgs(body.Member.Name));
}
}
}
#endregion
}
public
class
Employee : INotifyPropertyChanged
{
Int32 _EmployeeID;
String _FirstName;
String _SurName;
Location _DefaultStore;
float
_Sallary;
float
_HourlyRate;
EmployeeType _EmployeeType;
Address _Address;
public
Int32 EmployeeID
{
get
{
return
_EmployeeID;
}
set
{
_EmployeeID = value;
NotifyPropertyChanged(() => EmployeeID);
}
}
public
String FirstName
{
get
{
return
this
._FirstName;
}
set
{
this
._FirstName = value;
NotifyPropertyChanged(() => FirstName);
}
}
public
String SurName
{
get
{
return
this
._SurName;
}
set
{
this
._SurName = value;
NotifyPropertyChanged(() => SurName);
}
}
public
Location DefaultStore
{
get
{
return
this
._DefaultStore;
}
set
{
this
._DefaultStore = value;
NotifyPropertyChanged(() => DefaultStore);
}
}
public
float
Sallary
{
get
{
return
this
._Sallary;
}
set
{
this
._Sallary = value;
NotifyPropertyChanged(() => Sallary);
}
}
public
float
HourlyRate
{
get
{
return
this
._HourlyRate;
}
set
{
this
._HourlyRate = value;
NotifyPropertyChanged(() => HourlyRate);
}
}
public
EmployeeType EmployeeType
{
get
{
return
this
._EmployeeType;
}
set
{
this
._EmployeeType = value;
NotifyPropertyChanged(() => EmployeeType);
}
}
public
Address Address
{
get
{
return
_Address;
}
set
{
_Address = value;
NotifyPropertyChanged(() => Address);
}
}
public
Employee()
{
}
public
Employee(Int32 employeeID, String firstName, String surName, Location defaultStore,
float
sallary,
float
hourlyRate, EmployeeType employeeType, Address address)
{
this
._EmployeeID = employeeID;
this
._FirstName = firstName;
this
._SurName = surName;
this
._DefaultStore = defaultStore;
this
._Sallary = sallary;
this
._HourlyRate = hourlyRate;
this
._EmployeeType = employeeType;
this
._Address = address;
}
#region PropertyNotify
[field: NonSerializedAttribute()]
public
event
PropertyChangedEventHandler PropertyChanged =
delegate
{ };
public
readonly
Action<Action> _synchronousInvoker;
public
Employee(Action<Action> synchronousInvoker)
{
_synchronousInvoker = synchronousInvoker;
}
public
void
NotifyPropertyChanged<T>(Expression<Func<T>> expr)
{
var body = expr.Body
as
MemberExpression;
if
(body !=
null
)
{
try
{
if
(_synchronousInvoker !=
null
)
_synchronousInvoker(() => InvokePropertyChanged(expr));
else
InvokePropertyChanged(expr);
}
catch
(Exception Ex)
{
if
(Ex.Message ==
"Invoke or BeginInvoke cannot be called on a control until the window handle has been created."
)
{
InvokePropertyChanged(expr);
}
}
}
}
private
void
InvokePropertyChanged<T>(Expression<Func<T>> expr)
{
var body = expr.Body
as
MemberExpression;
if
(body !=
null
)
{
if
(PropertyChanged !=
null
)
{
PropertyChanged(
this
,
new
PropertyChangedEventArgs(body.Member.Name));
}
}
}
#endregion
}
public
class
EmployeeCollection : ObservableCollection<Employee>
{
public
EmployeeCollection()
{
}
}
[MetadataType(
typeof
(Part.PartMetadata))]
public
partial
class
Part : IValidatableObject {
private
sealed
class
PartMetadata {
[RegularExpression(@
"[0-9A-F]{4,20}"
)]
// Not respected by the RadGridView
public
string
PartNumber {
get
;
set
; }
}
public
IEnumerable<ValidationResult> Validate(ValidationContext validationContext) {
if
(PartNumber == DrawingNumber) {
yield
return
new
ValidationResult(
"part number = drawing number"
,
new
string
[] {
"PartNumber"
,
"DrawingNumber"
});
}
}
}