Telerik Forums
UI for WPF Forum
2 answers
169 views
I have a need to support the dragging of images (.JPG files) from Windows Explorer and dropping them onto a TileView (creating a new tile with that image).  I've seen examples of dragging and dropping items originating in a Telerik control (ie, a TreeView or ListBox) and dropping them to a TileView, but nothing where the source originates outside the application containing the TileView control.  I've set the TileView's OnDrop property and have a OnDrop handler, but the handler never gets invoked when the image is dropped on the TileView.  Any help would be greatly appreciated.

Kevin
Top achievements
Rank 1
 answered on 06 Aug 2013
2 answers
121 views
Hi,

I tried to work with bound Properties on ConnectorShapes.
This works fine - as Long as I do not clear the InternalItems / InternalLinks in the Graph source.

First the Style (part of it)
<Style TargetType="telerik:RadDiagramConnection" >
        <!---->
        <Setter Property="Visibility" Value="{Binding Visibility, Mode=TwoWay}" />
        <!---->

Now my (simple) classes:
(forget about INPBase - it's just an implementation of INotifyPropertyChanged
The Node:
public class Item : INPBase {
        #region Content
        private string _Content;
        public string Content {
            get { return _Content; }
            set { Set(ref _Content, value); }
        }
        #endregion
    }


The Link:
public class Link : INPBase, ILink<Item> {
    public Visibility Visibility { get; set; }
    public Item Source { get; set; }
    public Item Target { get; set; }
 
    object ILink.Source {
        get { return ((object)Source); }
        set { if (!((object)Source).Equals(value)) { Source = value as Item; } }
    }
    object ILink.Target {
        get { return ((object)Target); }
        set { if (!((object)Target).Equals(value)) { Target = value as Item; } }
    }
    public Link() { Visibility = Visibility.Visible; }
}


The Tree:
public class TestTree : INPBase, IGraphSource {
        public ObservableCollection<Item> InternalItems { get; private set; }
        public ObservableCollection<Link> InternalLinks { get; private set; }
        public Item RootNode { get; private set; }
        public System.Collections.IEnumerable Items {           get { return (InternalItems); }     }
        public IEnumerable<ILink> Links {           get { return(InternalLinks); }      }
 
        public TestTree() {
            InternalItems = new ObservableCollection<Item>();
            InternalLinks = new ObservableCollection<Link>();
            BuildTree();
        }
        private void BuildTree() {
            RootNode = new Item() { Content = "One" };
            Item iTwo = new Item() { Content = "Two" };
            Item iThree = new Item() { Content = "Three" };
            Item iFour = new Item() { Content = "Four" };
            InternalItems.Add(RootNode);
            InternalItems.Add(iTwo);
            InternalItems.Add(iThree);
            InternalItems.Add(iFour);
            InternalLinks.Add(new Link() { Target = RootNode, Source = iTwo });
            InternalLinks.Add(new Link() { Target = RootNode, Source = iThree });
            InternalLinks.Add(new Link() { Target = RootNode, Source = iFour });
        }
        public void RebuildTree() {
            InternalLinks.Clear();
            InternalItems.Clear();
            BuildTree();
        }
        public void AddNodeWithLink() {
            Item iNew = new Item() { Content = "I" + InternalItems.Count.ToString() };
            Item iSource = InternalItems.First();
            InternalItems.Add(iNew);
            InternalLinks.Add(new Link() { Target = iSource, Source = iNew });
        }
    }


Last not Least I have a "ViewModel" like this:
public class TestVM : INPBase {
    private TestTree _TestTree;
    public TestTree TestTree {
        get { return _TestTree; }
    }
    public TestVM() {
        _TestTree = new TestTree();
    }
    public void AddNode() {
        _TestTree.AddNodeWithLink();
    }
    public void Rebuild() {
        _TestTree.RebuildTree();
    }
 
}
(of course in real code things are handled via commands - but that doesn't matter)


Everything works fine - as long as I'm not resetting the tree.
After this I get the debug message:

System.Windows.Data Error: 40 : BindingExpression path error: 'Visibility' property not found on 'object' ''TestVM' (HashCode=61656587)'. BindingExpression:Path=Visibility; DataItem='TestVM' (HashCode=61656587); target element is 'RadDiagramConnection' (Name=''); target property is 'Visibility' (type 'Visibility')


So it seems as if clearing the collections move the datacontext "on step up".
My Binding is simple the UserControl (hosting the diagram) has an Instance of TestVM as DataContext and the Diagram is bound like this:
<Grid DataContext="{Binding}" x:Name="grdHolder">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Content="Add node" VerticalAlignment="Center" HorizontalAlignment="Left" Click="AddNode_Click" />
        <Button Content="Rebuild" VerticalAlignment="Center" HorizontalAlignment="Center" Click="Rebuild_Click" />
        <Button Content="Layout" VerticalAlignment="Center" HorizontalAlignment="Right" Click="Layout_Click" />
        <telerik:RadDiagram x:Name="dG" GraphSource="{Binding TestTree}" Grid.Row="1"/>
    </Grid>

Thank you
Manfred


ManniAT
Top achievements
Rank 2
 answered on 06 Aug 2013
1 answer
285 views
I'm using radtabcontrol and added another screen(pending screen) as grid in the radcontrolItem like this,

Radcontrol.xaml
<telerik:RadTabItem  >
                    <telerik:RadTabItem.Content>
                     
 
                            <Grid  Name="displaypending" >
                                <Grid.RowDefinitions>
 
                                    <RowDefinition Height="*" />
 
                                </Grid.RowDefinitions>
 
                            </Grid>
                    
                    </telerik:RadTabItem.Content>
                </telerik:RadTabItem>

Radcontrol.xaml.cs

if (displaypending != null)
              {
                  displaypending.Children.Clear();
                  Pending pending = new Pending();
                  displaypending.Children.Add(pending);
                  IsScanningAllowed = ApplicationVariables.IsScannerInitiated;
                }

RadtabItem Content Header will be changed based on button click of pending screen, but i can't able to get changed header immediately after the button click, i need to reload the screen manually to get the changed header. So how to get the changed header without manually reload.
Pavel R. Pavlov
Telerik team
 answered on 06 Aug 2013
1 answer
87 views

Hi,

I have a layout with RadTreeView docked to left using RadDocking and a RadTileView inside a DocumentHose. While I unpin the panel which is docked to left and don't move the mouse from pin button, the unpinned panel expands again but it is empty.

Please find my code below:

     <telerik:RadDocking Background="Transparent" BorderThickness="0" HorizontalAlignment="Left" >
            <telerik:RadDocking.DocumentHost>

                    <telerik:RadTileView x:Name="c_tileView" ColumnWidth="Auto" RowsCount="2"
                             RowHeight="Auto" MinimizedColumnWidth="450" MinimizedRowHeight="150"
                             IsItemsSizeInPercentages="True" PreservePositionWhenMaximized="true"
                             telerik:TileViewPanel.IsColumnsShrinkEnabled="True"
    telerik:TileViewPanel.IsRowsShrinkEnabled="True"
                             telerik:TileViewPanel.IsSizeBoundToPosition="True"
                             telerik:PersistenceManager.StorageId="tileView">

                        <telerik:RadTileViewItem RestoredHeight="30" MinimizedHeight="150" RestoredWidth="28" >
                            <Rectangle/>
                        </telerik:RadTileViewItem>

                        <telerik:RadTileViewItem RestoredHeight="25" MinimizedHeight="150" RestoredWidth="48" >
                            <Rectangle/>
                        </telerik:RadTileViewItem>

                        <telerik:RadTileViewItem RestoredHeight="50" MinimizedHeight="150" RestoredWidth="24" >
                            <Rectangle/>
                        </telerik:RadTileViewItem>                      
                    </telerik:RadTileView>

            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer MaxWidth="300" telerik:DockingPanel.InitialSize="210,150" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Screen Models" CanUserClose="False"
            ContextMenuTemplate="{x:Null}"
            CanDockInDocumentHost="False" IsPinned="False">
                        <telerik:RadTreeView x:Name="c_treeView" Grid.Row="1" Margin="0"
              VerticalAlignment="Stretch" IsLineEnabled="True"
              ScrollViewer.HorizontalScrollBarVisibility="Auto"
              IsDragDropEnabled="False">
                            <telerik:RadTreeViewItem Header="Test A" IsExpanded="True">
                                <telerik:RadTreeViewItem Header="Model A"/>
                                <telerik:RadTreeViewItem Header="Model B"/>
                                <telerik:RadTreeViewItem Header="Model C"/>
                                <telerik:RadTreeViewItem Header="Model D"/>
                            </telerik:RadTreeViewItem>

                        </telerik:RadTreeView>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
          
        </telerik:RadDocking>

Kalin
Telerik team
 answered on 06 Aug 2013
1 answer
90 views
Hi,

I have a problem with a radWindow in our application in that it does not function correctly on Windows 8. The problem is that the window is displayed correctly but none of the bindings to the viewmodel (data context) work, however there are no binding errors in the output window. Also when you check the datacontext on the window it is set to the correct viewmodel its just as if the bindings are not working. The window contains a few listboxes and a radGridview and they do not display any data, but as stated no binding errors are reported. The strange thing is that the same window works perfectly on Windows 7/XP, also if you show the window from an existing modal radWindow it works as expected on Windows 8. The problem only occurs when the Window is displayed and only the main application shell window is visible which is a radRibbonWindow. I know its a bit of a long shot but has anyone got an idea on what may be causing this, with no errors or exceptions to go on its proving a real problem for us to fix?

Thanks
Vladi
Telerik team
 answered on 06 Aug 2013
2 answers
122 views
Hello

We trying to implement the master-detail WPF app to learn the capabilities of Telerik RadGridView.

It is a simple application which has RadGridView with the following markup:
<telerik:RadGridView ItemsSource="{Binding Persons}" SelectedItem="{Binding Selectedperson, Mode=TwoWay}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutoGenerateColumns="True" telerik:StyleManager.Theme="Windows7">
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition>
                </telerik:GridViewTableDefinition>
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView
                            AutoGenerateColumns="True"
                            telerik:StyleManager.Theme="Windows7"
                            ItemsSource="{Binding Details}">
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
Under the hood is view model which is set to DataContext of the main windows where Telerik RadGridView is placed, as follows:
namespace MasterDetailViaDataTables
{
    public partial class MainWindow : Window
    {
 
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new MainViewModel();
        }

Persons and Details are fields of view model which are ObservableCollection of appropriate instances.
PersonDetails.cs:
namespace MasterDetailViaDataTables
{
    public class PersonDetails : BindableBase
    {
        private int _PersonID;
        public int PersonID
        {
            get { return _PersonID; }
            set { this.SetProperty<int>(ref this._PersonID, value); }
        }
 
        private string address;
        public string Address
        {
            get { return address; }
            set { this.SetProperty<string>(ref this.address, value); }
        }
 
        private string _Description;
        public string Description
        {
            get { return _Description; }
            set { this.SetProperty<string>(ref this._Description, value); }
        }
 
        public static ObservableCollection<PersonDetails> GetDetails()
        {
            ObservableCollection<PersonDetails> details = new ObservableCollection<PersonDetails>();
            try
            {
                DataTable table = new DataTable("persondetail");
                DataColumn PersonID = new DataColumn("PersonID", typeof(System.Int64));
                DataColumn Address = new DataColumn("Address", typeof(System.String));
                DataColumn Description = new DataColumn("Description", typeof(System.String));
                table.Columns.Add(PersonID);
                table.Columns.Add(Address);
                table.Columns.Add(Description);
 
                for (int pID = 1; pID <= 5; pID++)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        DataRow row = table.NewRow();
                        row["PersonID"] = pID;
                        row["Address"] = "Address" + (pID-1).ToString() + " - " + i.ToString();
                        row["Description"] = "Description" + (pID-1).ToString() + " - " + i.ToString();
                        table.Rows.Add(row);
                    }
                }
 
 
                details.Clear();
 
                for (int i = 0; i < table.Rows.Count; ++i)
                    details.Add(new PersonDetails
                    {
                        PersonID = Convert.ToInt32(table.Rows[i][0]),
                        Address = table.Rows[i][1].ToString(),
                        Description = table.Rows[i][2].ToString()
                    });
 
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return details;
        }
    }
Person.cs:
public class Person : BindableBase
{
    private int _PersonID;
    private string _FirstName;
    private string _LastName;
 
    public int PersonID
    {
        get { return _PersonID; }
        set { this.SetProperty<int>(ref this._PersonID, value); }
    }
 
    public string FirstName
    {
        get { return _FirstName; }
        set { this.SetProperty<string>(ref this._FirstName, value); }
    }
 
    public string LastName
    {
        get { return _LastName; }
        set { this.SetProperty<string>(ref this._LastName, value); }
    }
 
    public static ObservableCollection<Person> GetPersons()
    {
        ObservableCollection<Person> persons = new ObservableCollection<Person>();
        try
        {
            DataTable table = new DataTable("person");
            DataColumn id = new DataColumn("PersonID", typeof(System.Int64));
            id.AutoIncrement = true;
            id.AutoIncrementSeed = 1;
            DataColumn FirstName = new DataColumn("FirstName", typeof(System.String));
            DataColumn LastName = new DataColumn("LastName", typeof(System.String));
            table.Columns.Add(id);
            table.Columns.Add(FirstName);
            table.Columns.Add(LastName);
 
            for (int i = 0; i < 5; i++)
            {
                DataRow row = table.NewRow();
                row["FirstName"] = "FirstName" + i.ToString();
                row["LastName"] = "LastName" + i.ToString();
                table.Rows.Add(row);
            }
 
            persons.Clear();
 
            for (int i = 0; i < table.Rows.Count; ++i)
                persons.Add(new Person
                {
                    PersonID = Convert.ToInt32(table.Rows[i][0]),
                    FirstName = table.Rows[i][1].ToString(),
                    LastName = table.Rows[i][2].ToString()
                });
 
 
 
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
 
        }
        return persons;
    }
 
 
}
MainViewModel.cs:
public class MainViewModel : BindableBase, INotifyPropertyChanged
{
    public MainViewModel()
    {
        this.Persons = Person.GetPersons();
    }
 
    private ObservableCollection<Person> personValues;
    public ObservableCollection<Person> Persons
    {
        get { return personValues; }
        set { this.SetProperty<ObservableCollection<Person>>(ref this.personValues, value); }
    }
 
 
    private ObservableCollection<PersonDetails> detailsvalues;
    public ObservableCollection<PersonDetails> Details
    {
        get
        {
            if (this.Selectedperson == null)
            {
                return null;
            }
            return this.LoadDetails(this.Selectedperson.PersonID);
        }
 
    }
 
    private ObservableCollection<PersonDetails> LoadDetails(int personID)
    {
        ObservableCollection<PersonDetails> details = new ObservableCollection<PersonDetails>();
        foreach (PersonDetails detail in PersonDetails.GetDetails().Where(item => item.PersonID == personID))
        {
            details.Add(detail);
        }
        return details;
    }
 
    private Person selectedPersonValue;
    public Person Selectedperson
    {
        get { return selectedPersonValue; }
        set
        {
            this.SetProperty<Person>(ref this.selectedPersonValue, value);
            this.RaiseNotification("Details");
        }
    }
 
}

We can't get working hierarchical RadGridView. When we trying to expand the parent row, we see the following in the Output window:
System.Windows.Data Error: 40 : BindingExpression path error: 'Details' property not found on 'object' ''Person' (HashCode=43402647)'.
BindingExpression:Path=Details; DataItem='Person' (HashCode=43402647); target element is 'RadGridView' (Name=''); target property is 'ItemsSource' (type 'Object')
We can't figure out what is wrong here, can you help us?
Onotole
Top achievements
Rank 1
 answered on 06 Aug 2013
1 answer
158 views
Hi guys,

I'm trying to use the pdfviewer but in the designer I get the message:

Error    93    Method 'RegisterMouseRightButtonDown' in type 'Telerik.Windows.Documents.Fixed.UI.MouseHandlers.SelectionHandler' from assembly 'Telerik.Windows.Controls.FixedDocumentViewers, Version=2013.1.220.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' does not have an implementation.

Can you help me?

David.

Alexander
Telerik team
 answered on 06 Aug 2013
3 answers
195 views
Hi,

I have live data coming from a sensor at a rate of 1khz. This data is plotted on a RadCartesianChart with two LinearAxis for X and Y. Only the last 10 seconds or so needs to be shown to the user. This is why I remove the first datapoint as soon as 10,001 datapoints are recorded.

When RangeExtendDirection="Positive" is set on the X-axis the graph scrolls along quite nice, however the range is not updated smoothly. The graph jumps every so often when the end is reached. I would like the X-position on screen of start and end of the graph to remain the same. Is this possible? I have not been able to find a way to alter the range of a graph.

Wouter
Rosko
Telerik team
 answered on 06 Aug 2013
4 answers
305 views
Hi

I'm trying to migrate RadMaskedTextBox to RadMaskedTextInput and I'm experiencing strage behaviour in RadMaskedTextInput:

I have a TextBox where the content takes half of the TextBox width. With the RadMaskedTextBox I was able to click anywhere in the free part of the TextBox, hold down the mouse button and select the content with a move to the left side.

In RadMaskedTextInput I have to put the cursor right beside the last character in the TextBox to do this. The free parts of the TextBox just show the normal mouse cursor and not the text-input-cursor.

Is it possible to activate the behaviour of the old RadMaskedTextBox in the new RadMaskedTextInput for making a text-selection with the mouse?

Attached you will find 2 pictures:
The first TextBox on the pictures is the RadMaskedTextInput
The second TextBox is the RadMaskedTextBox

Picture1 (StartSelection.jpg) shows the start of the selection and the different cursors. At the point where you can see the cursors, I'm starting to hold down mouse left and move the mouse to the left

Picture2 (EndSelection) shows that only the text in the RadMaskedTextBox was selected as desired. The text in the RadMaskedTextInput remains unselected.

To select the text in the RadMaskedTextInput I have to move the cursor to the position shown in picture3 (radmaskedtextinput.jpg)
HAG
Top achievements
Rank 2
 answered on 06 Aug 2013
1 answer
150 views
Please show the proper use of SettingsPane.SettingsPaneViewStyle property.

Setting this property appears to do nothing.

Following http://www.telerik.com/help/wpf/raddiagram-extensions-settingspane.html I edited the control template of SettingsPaneView.  Setting the SettingsPaneViewStyle property to this new resource does nothing.  A bit frustrating since I was following the documentation.

Searching the forums I found this thread which contains a download from Zarko showing how to edit the SettingsPaneView control template.

http://www.telerik.com/community/forums/wpf/diagram/adding-my-own-properties-into-settingspane-of-raddiagram-on-selection-of-shape.aspx

In addition to editing the SettingsPaneView control template, his example also edits the SettingsPane template to hard code the use of the modified SettingsPaneView control template.  That's a small piece of very important information that has been left out of your documentation.

The apparently defunct SettingsPane.SettingsPaneViewStyle property either needs to be implemented or removed.

Yeah, I just edited the default SettingsPane control template and it does not contain a template biding to set the SettingsPaneView Style.  Here's the fix:

<telerik:SettingsPaneView x:Name="SettingsPaneView" ContextItems="{x:Null}" Diagram="{TemplateBinding Diagram}" 
Height="{TemplateBinding SettingsPaneViewHeight}" IsActive="{Binding IsActive, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" 
Margin="7,0,0,0" Width="{TemplateBinding SettingsPaneViewWidth}"
Style="{TemplateBinding SettingsPaneViewStyle}">

Mike
Petar Mladenov
Telerik team
 answered on 06 Aug 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?