Telerik Forums
UI for WPF Forum
6 answers
1.1K+ views
Hi all,

I am trying to get the parameter out of CommandParameter on a button click. I got the parameter values in the EXECUTE method. The issue is the type of my parameter is not what I expected and also I am unable to cast it. 

This is what I have as my parameter value.



Now, I can see the type of my parameter is Telerik.Windows.Controls.Primitives.SelectionChanger<object>​, but I am not able to cast it in codebehind as I cannot see Telerik.Windows.Controls.Primitives.SelectionChanger.  
Not sure if I am able to put my question correctly and completely. Please let me know if you need more information.

Regards,
Deepak
Lance | Senior Manager Technical Support
Telerik team
 answered on 22 Sep 2016
4 answers
957 views

Hi to all,

I don't understand wich property I have to set a not-editable combobox.

I've attached view in readonly-mode also. I hope it is clarifier.

I tryed with trigger and set IsReadOnly property, but ComboBox is still editable (I can't edit, but I can selected by dropdown)

 

01.<Style x:Key="FieldLongComboBoxStyle" TargetType="telerik:RadComboBox" BasedOn="{StaticResource RadComboBoxStyle}">
02.        <Setter Property="Margin" Value="5"/>
03.        <Setter Property="IsEditable" Value="True"/>
04.        <Setter Property="ClearSelectionButtonVisibility" Value="Visible"/>
05.        <Setter Property="ClearSelectionButtonContent" Value="Cancella selezione"/>
06.        <Setter Property="TextSearchMode" Value="StartsWith"/>
07.        <Setter Property="EmptyText" Value="Valore non selezionato"/>
08.        <Setter Property="Width" Value="200"/>
09.        <Setter Property="HorizontalAlignment" Value="Left"/>
10.        <Style.Triggers>
11.            <DataTrigger Binding="{Binding CantUpdateModel}" Value="True">
12.                <Setter Property="IsReadOnly" Value="True"/>
13.            </DataTrigger>
14.            <DataTrigger Binding="{Binding CantUpdateModel}" Value="False">
15.                <Setter Property="IsReadOnly" Value="False"/>
16.            </DataTrigger>
17.        </Style.Triggers>
18.    </Style>

Dario Concilio
Top achievements
Rank 2
 answered on 21 Sep 2016
3 answers
257 views

Hi to all,

I created a RadWindow that contains WebBrowser control.

Simply, I execute Navigate method in Loaded event of RadWindow

It navigates to local url http://mylocalserver:8090/blablabla

When I open the window it appers empy, but if view HTML source is full, moreover, if I try to printer preview appers all content of webpage.

Are there problems between RadWindow control and WebBrowser?

PS: I tryed to exec InvalidateLayout method of RadWindow, but without resolve.

 

<telerik:RadWindow x:Class="Brema.Client.Helpers.BlogViewer"
        Header="Aiuto in linea" Height="640" Width="480" WindowStartupLocation="CenterScreen" Style="{StaticResource RadWindowStyle}">
    <Grid>
        <WebBrowser x:Name="MainWebBrowser" />
    </Grid>
</telerik:RadWindow>

Dario Concilio
Top achievements
Rank 2
 answered on 21 Sep 2016
2 answers
108 views

Hello,

 

I am refering to this documentation http://docs.telerik.com/devtools/wpf/api/html/P_Telerik_Windows_Controls_RadComboBox_TextInputString.htm

 

I want to get the InputString. I have updated the dll to version 2016.3.914 but still I could not find the property in XAML.

Could someone tell me what have I done wrong?

Nasko
Telerik team
 answered on 21 Sep 2016
2 answers
58 views

Hello,

when in edit mode with a row validation error it is still possible to perform Drag&Drop operations. They are not visible while performing the Drop, but the rows will be sorted just after clearing the row validation error.

Greeting

Raul

Raul
Top achievements
Rank 1
 answered on 21 Sep 2016
3 answers
309 views

I have the following property in my ViewModel:

public double? MinimalValue
{
   get { return this._minimalValue; }
   set { this.SetProperty(ref this._minimalValue, value); }
}

In XAML I try to bind RadNumericUpDown.Value property to abovementioned property in the following way:

<telerik:RadNumericUpDown Grid.Row="0" Grid.Column="1" Height="30" Margin="0 30 10 0" IsEditable="True" Value="{Binding MinimalValue, Mode=TwoWay}"/>

But the following error occurs: 'Value' local property is applied only to the types that are derivative from 'RadRangeBase'. So can I bind  RadNumericUpDown.Value property to the property in my ViewModel or not?

Nasko
Telerik team
 answered on 21 Sep 2016
2 answers
76 views

Hi,

 

I am using RadWindow.Alert and RadWindow.Confirm. I am getting a strange box around the text . I have attached the files.

 

Martin
Telerik team
 answered on 21 Sep 2016
2 answers
164 views

Hi,

I am quite new to Telerik and I am trying to set up automated tests for our WPF application. Whenever I try to use 'bar.User.TypeText("SomeText", 200)' to a framework element (found using 'FrameworkElement bar= foo.MainWindow.Find.ByAutomationId("New_Proj_Text_Box");') it sends a couple of letters to the TextBox, but then it cuts stops sending text.

 

I think that this may be something to do with the window loading as the TextBox is in a Modal window and when you open the modal window mmanually (rather than using the link via Telerik) SendText sends all the text to to the TextBox.

 

I have tried to introduce an "ensureClickable", changed the times for the "keyPressTime" and changing the clickFirst argument (trying both True and False). Unfortunately none of these seem to work.

 

I have placed my test below. Unfortunately there are no helpful errors in the logs.

 

Any help on this would be hugely appreciated.

 

Many thanks in advance,

 

David

 

 

using ArtOfTest.WebAii.Controls.Xaml.Wpf;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.TestTemplates;
using ArtOfTest.WebAii.Wpf;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTestProject2
{
    /// <summary>
    /// Summary description for TelerikNUnitTest1
    /// </summary>
    [TestClass]
    public class TelerikNUnitTest1 : BaseWpfTest
    {

        private TestContext testContextInstance;

        public WpfApplication foo { get; private set; }

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>

        [TestMethod]
        public void Open_Application()
        {
            
            Settings mySettings = new Settings();
            mySettings.ClientReadyTimeout = 60000;

            /// Use my Settings object to construct my Manager object
            Manager myManager = new Manager(mySettings);
            myManager.Start();

            // Launch the application instance from its location in file system
            WpfApplication fubar = myManager.LaunchNewApplication(@"C:\Users\e-ddcr\Documents\appLocation\Fubar.Startup.exe");

            /// Validate the title of the homepage
            ArtOfTest.Common.UnitTesting.Assert.IsTrue(fubar.MainWindow.Window.Caption.Equals("MainWindow"));
            //TestContext.WriteLine("Validated window");

            ///Click the new project button
            FrameworkElement newProjButton = fubar.MainWindow.Find.ByTextContent("New project...");
            newProjButton.User.Click();

            ///Send keys to the project name textbox
            FrameworkElement projNameTextBox = fubar.MainWindow.Find.ByAutomationId("New_Proj_Text_Box");
            projNameTextBox.EnsureClickable();
            projNameTextBox.User.Click();
            projNameTextBox.User.TypeText("PokeMoon", 100);
                 
        }

    }

}

Georgi
Telerik team
 answered on 21 Sep 2016
2 answers
100 views

Hello.

I discovered that styling empty table cells works while editing, but the formatting is lost when the RadDocument is converted to RTF format and back again.       
I have created Test() method to demonstrate a simple conversion that does not work.

in EditControl.xaml.cs

private void Test()
{
      var provider = new RtfFormatProvider();
          var rtfString = provider.Export(_radRichTextBox.Document);     
          _radRichTextBox.Document = provider.Import(rtfString);
}

in EditControl.xaml

<telerik:RadRichTextBox x:Name="_radRichTextBox" />

 

Attached is a 3 step process outlining how this is breaking for me. Thanks for the help.

Nathanial
Top achievements
Rank 1
 answered on 21 Sep 2016
3 answers
233 views

Hi,

i need to create PDF bookmarks programmatically and using RadDocument model api instead of RadDocumentEditor. 

My code looks like this:

// Create section with header, footer and two paragraphs.     
Section section = new Section();
 
// Create bookmark.
var titleSpan = new Span(title);
BookmarkRangeStart start = new BookmarkRangeStart(title);
BookmarkRangeEnd end = new BookmarkRangeEnd();
start.End = end;
end.Start = start;
 
Paragraph headingParagraph = new Paragraph() { StyleName = "Heading1" };
 
// Insert inlines.
headingParagraph.Inlines.Add(start);
headingParagraph.Inlines.Add(titleSpan);
headingParagraph.Inlines.Add(end);
 
section.Blocks.Add(headingParagraph);
 
this.radDocument.Sections.Add(section );

 

but when I open document in AdobeReader there aren't any bookmarks.

What's wrong with this code?

Thank you.

Tanya
Telerik team
 answered on 21 Sep 2016
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?