Telerik.Windows.Documents.Model.Span spanbox = editor.Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan;
StyleDefinition expansionstyle =
new
StyleDefinition();
expansionstyle.SpanProperties =
new
SpanProperties() { FontWeight = FontWeights.SemiBold, ForeColor = Colors.Brown };
if
(spanbox.FontWeight == FontWeights.SemiBold && spanbox.ForeColor == Colors.Brown)
{
Telerik.Windows.Documents.Model.Section currsect = editor.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection;
bool
check = editor.Document.CaretPosition.MoveToNextInline();
var documentelement = editor.Document.CaretPosition.GetCurrentTableBox();
if
(documentelement!=
null
&& documentelement.GetType() ==
typeof
(TableLayoutBox))
{
spanbox.Tag = Guid.NewGuid().ToString();
//var tableStyle = editor.Document.StyleRepository["TableGrid"] as StyleDefinition;
Telerik.Windows.Documents.Model.Table tbl = documentelement.AssociatedTable;
if
(tbl !=
null
)
{
TableHelper Thelp =
new
TableHelper();
Thelp.TableReferenceId = spanbox.Tag;
foreach
(Telerik.Windows.Documents.Model.TableRow c
in
tbl.Rows)
{
TableRowHelper rowhelper =
new
TableRowHelper();
foreach
(Telerik.Windows.Documents.Model.TableCell cell
in
c.Cells)
{
TableCellHelper cellhepl =
new
TableCellHelper();
foreach
(DocumentElement block
in
cell.Blocks)
{
DocumentElementCollection docelement =
new
DocumentElementCollection(block);
foreach
(var item
in
block.Children)
{
docelement.Add(item);
}
cellhepl.DocumentElementCollection.Add(docelement);
}
rowhelper.TableCellCollection.Add(cellhepl);
}
Thelp.TableRowHelperCollection.Add(rowhelper);
}
TableHelpCollection.Add(Thelp);
ExpandedColl.Add(spanbox.Tag, tbl);
//stylecoll.Add(spanbox.Tag, tableStyle);
}
styles.Add(spanbox.Tag, documentelement.AssociatedTable.Style);
currsect.Blocks.Remove(tbl);
//editor.Document.StyleRepository.Add(tableStyle);
}
I have a custom connection class as shown below. I have removed the 5 connectors of my nodes ("Auto", "Left", "Right", "Top", "Bottom") and added my own connectors "In" and "Out".
public class MyChartConnection : RadDiagramConnection
{
public MyChartConnection(MyLink link)
: base()
{
SourceConnectorPosition = /*ConnectorPosition.Auto*/ "in";
SourceCapType = link.SourceCapType;
TargetConnectorPosition = /*ConnectorPosition.Auto*/ "out";
TargetCapType = link.TargetCapType;
}
}
This crashes when I try to apply your TreeLayout(). Apparently, it cannot find the "Bottom" connector... Should I use another layout class? Do I have to implement my own layout class?
We are unable to automate testing for our WPF application using MS Coded UI test. The sample application contains a RadGridView with just two columns. In one column, we have added a button which displays a Message Box on click. We are trying to automate this button click.
The grid is defined like this:
<telerik:RadGridView x:Name="MyLinkGrid" Height="135" AutoGenerateColumns="False" Margin="10" Width="300">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn x:Name="GridViewDataColumnID" Header="ID" DataMemberBinding="{Binding Name}" />
<telerik:GridViewColumn x:Name="GridViewDataColumnName" Header="Name" IsReadOnly="True">
<telerik:GridViewColumn.CellStyle>
<Style TargetType="telerik:GridViewCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Button x:Name="colID" Content="{Binding ID}" VerticalContentAlignment="Center" Foreground="Blue" Click="Button_Click" Width="Auto" AutomationProperties.AutomationId="{Binding ID}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:GridViewColumn.CellStyle>
</telerik:GridViewColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Button_Click");
}
During playback the button click event is not automated.
However if we move the ID column after the Name column, the button click event is played back and message box is displayed.
Attached is the sample WPF app along with the Coded UI test project.
Also if we add DataTemplate to our column definition, the button click event doesn’t occur during playback.
var outputsuperImposedLineSeries =
new
LineSeries();
outputsuperImposedLineSeries.ValueBinding =
new
PropertyNameDataPointBinding(
"Value"
);
outputsuperImposedLineSeries.CategoryBinding =
new
PropertyNameDataPointBinding(
"Timestamp"
);
outputsuperImposedLineSeries.ItemsSource = superImposedMappings.Groups.First()
as
IEnumerable;
outputsuperImposedLineSeries.Stroke = Brushes.Purple;
outputsuperImposedLineSeries.TrackBallInfoTemplate = BuildTrackBallInfoTemplate(Brushes.Purple.ToString(), name, 4);
outputsuperImposedLineSeries.VerticalAxis =
new
LinearAxis { Minimum = 0, ElementBrush = Brushes.Purple, Title = name, HorizontalLocation = Telerik.Charting.AxisHorizontalLocation.Right };
superImposedSeries.Add(outputsuperImposedLineSeries);
var actualInItem =
new
GridViewSummaryItem(
"ActualIn"
,
"{0:C}"
, GridAggregateFunction.Sum);<br> var actualOutItem =
new
GridViewSummaryItem(
"ActualOut"
,
"{0:C}"
, GridAggregateFunction.Sum);<br> var grossItem =
new
GridViewSummaryItem(
"Gross"
,
"{0:C}"
, GridAggregateFunction.Sum);<br> var operatorShareItem =
new
GridViewSummaryItem(
"OperatorShare"
,
"{0:C}"
, GridAggregateFunction.Sum);<br> var CmsnLocationItem =
new
GridViewSummaryItem(
"CmsnLocation"
,
"{0:C}"
, GridAggregateFunction.Sum);<br> var overShortItem =
new
GridViewSummaryItem(
"OverShort"
,
"{0:C}"
, GridAggregateFunction.Sum);<br> var PayoutPercentage =
new
GridViewSummaryItem(
"PayoutPercentage"
,
"Avg: {0:P1}"
, GridAggregateFunction.Avg);<br><br> var summaryRowItem =
new
GridViewSummaryRowItem(<br>
new
[] { actualInItem, actualOutItem, grossItem, overShortItem, operatorShareItem, CmsnLocationItem, PayoutPercentage });<br><br><br> template.SummaryRowsBottom.Add(summaryRowItem);
public BillingView()
{
LocalizationManager.Manager = new LocalizationManager()
{
ResourceManager = GridViewResources.ResourceManager
};
InitializeComponent();
}