Telerik Forums
UI for WPF Forum
1 answer
148 views
Hi,

I am trying to remove table from blocks so above error message comes and table not able to remove.

my code
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);
                             
                            
                        }


how to resolve this error 
Petya
Telerik team
 answered on 04 Sep 2013
12 answers
266 views

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?

Kristoffer
Top achievements
Rank 1
 answered on 04 Sep 2013
0 answers
89 views

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. 

Tim
Top achievements
Rank 1
 asked on 04 Sep 2013
1 answer
246 views
The default implementation of the UndoRedoService is way too picky. Every possible UI transition adds an entry to the undo buffer. We don't want the user to be able to undo certain operations. E.g. when you click on a node, its ZIndex changes - implying a "Undo Set ZIndex" in the undo buffer. There are certainly more of these unnecessary undoables.

How can we customize this undo/redo behavior?
Pavel R. Pavlov
Telerik team
 answered on 04 Sep 2013
3 answers
96 views
Hi,

as you can see on the attached file, i have a category "Aufgabe" and a Resource called "Art" which contains the same items
like "Urlaub". Now i want to Change the Category and i want to Change the Resource item too. Same way if i Change the Resource Item
the category item should change too.

Thanks
Best Regards
Rene
Yana
Telerik team
 answered on 04 Sep 2013
2 answers
120 views
sds
I am curious if it is possible to add a lineseries (or other series) to a CartesianChartGrid with the characteristics of the "desired line" within the attached file.

This line will track a digital state, so the only values will be 0 and 1.  When changing value, we wish to produce the effect of a vertical line such as a block, rather than a gradual climb or descent as such in the "current line".

Below is the code which creates the "current line" series:

 

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);

Is this desired effect possible?

Thank you for your time,
-Brett

Edit:
The title should read "Help for creating a series to track digital values similar to a step".  My apologies for the incorrect title.
Brett
Top achievements
Rank 1
 answered on 03 Sep 2013
2 answers
97 views
Hi there, everytime I run my app appears this message in every RadGridView.
is there any possibility to delete them?

By the way, I'm using the under trial license

"Arrastre el encabezado del grupo....."
Enric
Top achievements
Rank 1
 answered on 03 Sep 2013
16 answers
3.2K+ views
Hi guys,

   I'm a WPF developer, and I'm looking for some sample code that will show me how to set the radGridView row background color based on the value of a column in the row. Do you have an example that will do so?
   Specifically, I want to set a row's background color to Red if the value of Due_Date is within 1 day of today, and to Yellow if it's between 2 and 3 days from today.

Thanks,

Les
Claudio
Top achievements
Rank 1
 answered on 03 Sep 2013
3 answers
478 views
How do I create summary rows in wpf . We are switching our windows form project to wpf and we are doing this in winforms:

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);

I can understand the aggregate functions can be done in my viewmodel but how do I add the summary row. Also, I have already used the row detail to display a child grid if that matters.
Dimitrina
Telerik team
 answered on 03 Sep 2013
3 answers
166 views
Hi!

Is is possible to get GridViewGroupPanelText to refresh when application culture changes? I have created custom resx (GridViewResources.en.resx and GridViewResources.resx) and it's working on initialization but does not change when the culture is changed during application execution.
 
I have added ResourceManager to .xaml.cs like this:

public BillingView()
{
     
    LocalizationManager.Manager = new LocalizationManager()
    {
        ResourceManager = GridViewResources.ResourceManager
    };
 
    InitializeComponent();
}

Br,

Kalle
Dimitrina
Telerik team
 answered on 03 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?