lstGridView.ForEach(p =>
{
if
(p.SortDescriptors !=
null
&& p.SortDescriptors.Count > 0)
{
p.RaiseEvent(
new
GridViewSortingEventArgs((p.SortDescriptors[0]
as
ColumnSortDescriptor).Column, SortingState.None, SortingState.Ascending) {
RoutedEvent = RadGridView.SortingEvent,
Source =
this
});
}
});
public void MakeExistingRowsReadOnly()
{
if (this.Items.ItemCount != 0)
{
for (int i = 0; i < this.Items.Count; i++)
{
GridViewRow currentrow = (GridViewRow)this.ItemContainerGenerator.ContainerFromItem(this.Items[i]);
if (!currentrow.Equals(null))
{
currentrow.IsEnabled =
false;
}
}
}
}
private static T FindChild<T>(DependencyObject parent) where T : DependencyObject
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(parent, i);
if (child != null && child is T)
return (T)child;
else
{
T childOfChild = FindChild<T>(child);
if (childOfChild != null)
return childOfChild;
}
}
return null;
}
<
StackPanel
>
<
telerik:RadTransitionControl
x:Name
=
"tr1"
>
<
Label
x:Name
=
"lblMessage"
></
Label
>
</
telerik:RadTransitionControl
>
<
Button
Content
=
"Button"
Height
=
"23"
Name
=
"button1"
Width
=
"75"
Click
=
"button1_Click"
/>
</
StackPanel
>
tr1.Content = DateTime.Now.ToString();
lblMessage.Content = DateTime.Now.ToString();
public
class
Reinforcement
{
private
string
fi;
private
bool
spacingMode;
private
int
amount;
private
double
spacing;
private
bool
combine =
false
;
private
double
area;
public
Reinforcement()
{
}
public
Reinforcement(
string
fi,
bool
spacingMode,
int
amount,
double
spacing,
bool
combine)
{
Fi = fi;
SpacingMode = spacingMode;
Amount = amount;
Spacing = spacing;
Combine = combine;
}
public
string
Fi
{
get
{
return
this
.fi;
}
set
{
this
.fi = value;
}
}
// (...)
}
public
class
ReinforcementViewModel
{
private
static
ObservableCollection<Reinforcement> reinforcementsByAmount;
private
static
ObservableCollection<Reinforcement> reinforcementsBySpacing;
public
static
ObservableCollection<Reinforcement> ReinforcementByAmount
{
get
{
if
(reinforcementsByAmount ==
null
)
{
reinforcementsByAmount =
new
ObservableCollection<Reinforcement>();
for
(
int
i = 1; i <= 10; i++)
{
reinforcementsByAmount.Add(
new
Reinforcement(
"10"
,
false
, i, 1,
false
));
reinforcementsByAmount.Add(
new
Reinforcement(
"12"
,
false
, i, 1,
false
));
(...)
}
}
return
reinforcementsByAmount;
}
}