or
<telerik:RadComboBox DisplayMemberPath="Dsc"
SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}"/>
</DataTemplate>
<
telerik:RadGridView
telerik:StyleManager.Theme
=
"Office_Blue"
Width
=
"auto"
Height
=
"200"
x:Name
=
"rgvTest"
ItemsSource
=
"{Binding TrckTest, IsAsync=True}"
DataLoadMode
=
"Asynchronous"
SelectionMode
=
"Extended"
AutoGenerateColumns
=
"False"
ScrollMode
=
"Deferred"
EnableRowVirtualization
=
"True"
SnapsToDevicePixels
=
"True"
UseLayoutRounding
=
"True"
ActionOnLostFocus
=
"None"
ShowInsertRow
=
"{Binding IsReadOnly}"
CanUserInsertRows
=
"{Binding IsReadOnly}"
CanUserDeleteRows
=
"{Binding IsReadOnly}"
Grid.Column
=
"0"
RowEditEnded
=
"rgvTest_RowEditEnded"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"RowEditEnded"
>
<
Commanding:EventToCommand
Command
=
"{Binding TestEditEndedCommand}"
PassEventArgsToCommand
=
"True"
/>
</
i:EventTrigger
>
<
i:EventTrigger
EventName
=
"AddingNewDataItem"
>
<
Commanding:EventToCommand
Command
=
"{Binding AddNewTestEvent}"
PassEventArgsToCommand
=
"True"
/>
</
i:EventTrigger
>
<
i:EventTrigger
EventName
=
"SelectionChanged"
>
<
Commanding:EventToCommand
Command
=
"{Binding ItemTestSelectedCommand}"
CommandParameter
=
"{Binding ElementName=rgvTest, Mode=OneWay, Path=SelectedItem}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
<
telerik:RadGridView.Columns
>
...
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
private
void
rgvTest_RowEditEnded(
object
sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
{
rgvTest.ScrollIntoView(e.Row);
}
// Local variables
bool
bResult =
true
;
TimeSpan DateDifference =
new
TimeSpan();
try
{
// Sampling threshold
this
.Chart.SamplingSettings.SamplingThreshold = 200;
this
.Chart.SamplingSettings.SamplingFunction = ChartSamplingFunction.Min;
// Settings for X axis --> manual setting for min, max, step, label step
this
.Chart.DefaultView.ChartArea.AxisX.IsDateTime =
true
;
// Note: set to true !!!!
this
.Chart.DefaultView.ChartArea.AxisX.AutoRange =
true
;
this
.Chart.DefaultView.ChartArea.AxisX.TicksDistance = 15;
// Set the label format depending on the selected timespan
DateDifference =
this
.m_dtDateTo.Subtract(
this
.m_dtDateFrom);
TimeSpan FifteenMinutes =
new
TimeSpan(0, 15, 0);
TimeSpan OneDay =
new
TimeSpan(1, 0, 0, 0);
TimeSpan OneMonth =
new
TimeSpan(31, 0, 0, 0);
TimeSpan OneYear =
new
TimeSpan(365, 0, 0, 0);
// Less than 15 minutes
if
(DateDifference.TotalMilliseconds < FifteenMinutes.TotalMilliseconds)
{
// Hours, minutes and seconds
this
.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"HH:mm:ss"
;
}
// Between 15 minutes and 1 day
else
if
((DateDifference.TotalMilliseconds > FifteenMinutes.TotalMilliseconds) && (DateDifference.TotalMilliseconds < OneDay.TotalMilliseconds))
{
// Hours and minutes
this
.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"HH:mm"
;
}
// Between 1 day and 31 days
else
if
((DateDifference.Days >= OneDay.Days) && (DateDifference.Days <= OneMonth.Days))
{
// Show the day
this
.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"M-dd"
;
// No auto range... the chart does not handle this properly in some cases
this
.Chart.DefaultView.ChartArea.AxisX.AutoRange =
false
;
this
.Chart.DefaultView.ChartArea.AxisX.MinValue =
this
.m_dtDateFrom.ToOADate();
this
.Chart.DefaultView.ChartArea.AxisX.MaxValue =
new
DateTime(
this
.m_dtDateTo.Year,
this
.m_dtDateTo.Month,
this
.m_dtDateTo.Day, 0, 0, 0).ToOADate();
DateTime aux1 =
new
DateTime(2000, 1, 1, 0, 0, 0);
DateTime aux2 =
new
DateTime(2000, 1, 2, 0, 0, 0);
double
Step = aux2.ToOADate() - aux1.ToOADate();
this
.Chart.DefaultView.ChartArea.AxisX.Step = Step;
this
.Chart.DefaultView.ChartArea.AxisX.LabelStep = 1;
}
else
if
((DateDifference.TotalMilliseconds > OneMonth.TotalMilliseconds) && (DateDifference.TotalMilliseconds <= OneYear.TotalMilliseconds))
{
// Month and year
this
.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"yyyy-M"
;
}
else
if
(DateDifference.TotalMilliseconds > OneYear.TotalMilliseconds)
{
// Year value
this
.Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =
"yyyy"
;
}
// Label orientation
this
.Chart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
this
.Chart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;
// Disable animations
this
.Chart.DefaultView.ChartArea.EnableAnimations =
false
;
// X Axis label style
this
.Chart.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle =
this
.Resources[
"ItemLabelStyle"
]
as
Style;
// Configuring the Y axis
this
.Chart.DefaultView.ChartArea.AdditionalYAxes.Clear();
// Get the lower Y axis index
this
.m_iLowerAxisIndex = (from axis
in
this
.m_obcAxisY
select axis.ID).Min();
foreach
(DLL_CustomControls.ReportChartSettings.AxisY obConfiguredAxisY
in
this
.m_obcAxisY)
{
if
(obConfiguredAxisY.ID ==
this
.m_iLowerAxisIndex)
{
// Configuration for the default axis
this
.Chart.DefaultView.ChartArea.AxisY.MinValue = obConfiguredAxisY.MinValue;
this
.Chart.DefaultView.ChartArea.AxisY.MaxValue = obConfiguredAxisY.MaxValue;
this
.Chart.DefaultView.ChartArea.AxisY.AutoRange = obConfiguredAxisY.AutoRange;
this
.Chart.DefaultView.ChartArea.AxisY.Title = obConfiguredAxisY.Label;
continue
;
}
// Create and add new axis
Telerik.Windows.Controls.Charting.AxisY NewAxis =
new
Telerik.Windows.Controls.Charting.AxisY();
NewAxis.MinValue = obConfiguredAxisY.MinValue;
NewAxis.MaxValue = obConfiguredAxisY.MaxValue;
NewAxis.AutoRange = obConfiguredAxisY.AutoRange;
NewAxis.AxisName = obConfiguredAxisY.ID.ToString();
NewAxis.Title = obConfiguredAxisY.Label;
// Add the secondary axis
this
.Chart.DefaultView.ChartArea.AdditionalYAxes.Add(NewAxis);
}
}
catch
(Exception ex)
{
bResult =
false
;
ExceptionManager.Write(
"DLL_CustomControls"
,
"ReportChart"
,
"ConfigureChart"
,
"Exception: "
+ ex.Message);
}
return
bResult;
// Capture the data
if
(!e.Result)
{
// Debug, warn and return
DebugManager.Write(DebugManager.DebugStatus.ERROR,
"DLL_CustomControls"
,
"ReportChart"
,
"OnGetDataCompleted"
,
"Error in the web service function for Serie ID = "
+ e.outSerieID.ToString() +
": "
+ e.strError);
MessageBox.Show(
"Error getting data for serie "
+ e.outSerieID.ToString() +
". Please try again."
,
"Error"
, MessageBoxButton.OK, MessageBoxImage.Exclamation);
return
;
}
// Capture the serie that has been processed
DLL_CustomControls.ReportChartSettings.ChartSerie obSerieToProcess =
null
;
obSerieToProcess = (from series
in
this
.m_obcSeries
where series.ID == e.outSerieID
select series).First();
// Process the serie data
if
(!ProcessSerieData(obSerieToProcess))
{
DebugManager.Write(DebugManager.DebugStatus.ERROR,
"DLL_CustomControls"
,
"ReportChart"
,
"OnGetDataCompleted"
,
"Error processing serie number "
+ e.outSerieID.ToString());
}
else
{
// If the list has points, process
if
(e.lstChartPoints !=
null
)
{
// Add to list of datasources of the chart
ObservableCollection<DLL_Resources.WCF_Clients.ChartValueDateDouble> obcPoints =
new
ObservableCollection<DLL_Resources.WCF_Clients.ChartValueDateDouble>();
// Convert in observable collection
foreach
(DLL_Resources.WCF_Clients.ChartValueDateDouble obPoint
in
e.lstChartPoints)
{
DLL_Resources.WCF_Clients.ChartValueDateDouble obNewPoint =
new
DLL_Resources.WCF_Clients.ChartValueDateDouble();
obNewPoint.XValueDateTime = obPoint.XValueDateTime;
obNewPoint.XValueDouble = obPoint.XValueDouble;
obNewPoint.YValue = obPoint.YValue;
// Add point
obcPoints.Add(obNewPoint);
}
this
.m_lstChartSource.Add(obcPoints);
}
}
The follow code doesn't work:
<
telerik:RadComboBox
Name
=
"testcc"
ItemsSource
=
"{Binding TestTypes}"
SelectedItem
=
"{Binding SelectedTestType}"
IsEditable
=
"True"
StaysOpenOnEdit
=
"True"
IsFilteringEnabled
=
"True"
TextSearchMode
=
"Contains"
DisplayMemberPath
=
"FullName"
/>
I tried setting OpenDropDownOnFocus="True", and it works only for the first time. When the ComboBox is still on focus but the dropdown is close, I tried typing in the textbox the dropdown will not open.
<CheckBox x:Name="ShowAll" Content="Show All" Click="ShowAll_Click" ></CheckBox>
<
telerik:RadTreeListView
x:Name
=
"MyTreeView"
EditTriggers
=
"None"
AutoGenerateColumns
=
"False"
local:SelectionBehavior.SelectionChanged
=
"{Binding Path=ItemSelectedCommand}"
ItemsSource
=
"{Binding ProjectDataInstances}"
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
HierarchyColumnIndex
=
"3"
>
<
telerik:RadTreeListView.ChildTableDefinitions
>
<
telerik:TreeListViewTableDefinition
ItemsSource
=
"{Binding Children, Converter={StaticResource NodeVisibilityConverter1}}"
/>
</
telerik:RadTreeListView.ChildTableDefinitions
>