Telerik Forums
UI for WPF Forum
3 answers
108 views
I'm trying to write a custom drag drop behaviour, and as I understand it I start by deriving a class from Telerik.Windows.Controls.DragDropBehavior. The problem is Telerik.Windows.Controls doesn't seem to contain the class DragDropBehavior. Have I completely misunderstood something?
Kalin
Telerik team
 answered on 16 Oct 2014
2 answers
320 views
Good day,

I'm wondering how can I fix wrong positioning (you can see how does it look right now in attached picture) of RadDiagramShapes in TreeDown? When I have like 5 nodes it works quite OK. But when i have let's say 90 nodes it becomes a mess.

I use this code after i fill RadDiagram with shapes and after i connect them with each other.
TreeLayoutSettings settings = new TreeLayoutSettings()
{
    TreeLayoutType = TreeLayoutType.TreeDown,
};
settings.Roots.Add(rd.Shapes[0]);
  
rd.RoutingService.Router = new OrgTreeRouter()
{
    TreeLayoutType = TreeLayoutType.TreeDown,
    ConnectionOuterSpacing = 20,
};
rd.LayoutAsync(LayoutType.Tree, settings);
rd.AutoFitAsync(new Thickness(0, 0, 0, 0), false);


I have only one root and I have already tried with positioning root shape on some position. Also i tried to fit layout after each diagram was put on diagram.

Thanks for your help.

Regards,

Gregor
Zarko
Telerik team
 answered on 16 Oct 2014
6 answers
448 views
Hello,

I have some problems with controls which inherit from Telerik Control like RadOutlookBarItem, RadRibbonTab...

When I try to switch the style at runtime (merging of xaml dictionaries), the style is not changed.

When there are no inheritance, it works great.

How can I solve that ?

Thanks in advance.

Geoffrey
Geoffrey
Top achievements
Rank 1
 answered on 16 Oct 2014
10 answers
663 views
Hello,
I want implement a GridView with the funcionality of add new entries on specific positions. For sample, the grid will be loaded with five static rows, and the user just can add a new row above it. This way, the new row created by the user can be deleted or a new row can be added above it again. So, basically is this: the pre-loaded rows are statics, can´t be deleted, and the new rows can be deleted or a new row can be created above it.
How could I create a new row always above other row? In the nameOfGrid.BeginInsert() method the new row is created on the bottom of grid. 

I´ve attached two images to demonstrate the desired behavior. The first one shows the static rows pre-loaded, just with the option to add a new row. The second shows a new row created on the bottom of grid, with the option to add and remove a row. 

Thanks in advance,

Thiago
Dimitrina
Telerik team
 answered on 16 Oct 2014
1 answer
223 views
Hello,

I need the filtered and sorted results from a RadGridView Control. RadGridView.Items contains the sorted/filtered/etc. data as DataItemCollection but I wonder if I could get the results as IEnumerable<T> and not as DataItemCollection. I need to have this because I am bound to a specific API.

I know I could cast it using RadGridView.Items.Cast<SpecificType>(); but I do not know the specific type because it is determined at runtime.

Thanks in advance
Boris
Telerik team
 answered on 15 Oct 2014
2 answers
310 views
Hi,
Can you please point me to an example of a RadTreeView inside of RadComboBox?
Is there an equivalent of RadDropDownTree in WPF?
Thank you.
Kristina
Telerik team
 answered on 15 Oct 2014
5 answers
219 views
I'm using a RadGridview with 2 columns of GridViewDataColumns and DataTemplate (TextBox, ComboBox). I need 2 tab switches to select the control of the cell.
How can I change it to 1 tab?
Boris
Telerik team
 answered on 15 Oct 2014
4 answers
234 views
I am using the PanelBar to display a two level hierarchy of menu items (Menu Sections and Menu Items). I am using a DataTemplate for the menu items and a HierarchicalDataTemplate for the root collection of menu sections. The binding is all working correctly. My problem arose when I attempted to make use of the SelectedItem Property on the PanelBar. When I bound the property to my view model (using either TwoWay or OneWayToSource) when expanding or collapsing the headers, a red border appears around the PanelBar. The animation becomes a little sluggish as well but I can live with that.

If I select one of the items the red border disappears - it will re-appear if I expand or collapse the header.  If I simply remove the binding or set the binding to OneWay the red border does no appear.

With the binding set to TwoWay or OneWayToSource the view model is updated correctly. Any other binding mode results in no update of the view model.

The appearance of the red border will be unacceptable to my client and I would really appreciate any help with how I can get it so stop appearing.

Here are snippets of my XAML:

01.<!-- Menu Item Data Template -->
02.<DataTemplate DataType="{x:Type entities:MenuItemModel}">
03.    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
04.        <StackPanel.ToolTip>
05.            <TextBlock Text="{Binding MenuItemDescription}"
06.                           HorizontalAlignment="Stretch" />
07.        </StackPanel.ToolTip>
08.        <TextBlock Text="{Binding MenuItemText}" HorizontalAlignment="Stretch"/>
09.    </StackPanel>
10.</DataTemplate>
11. 
12.<!-- Menu Section Data Template -->
13.<HierarchicalDataTemplate DataType="{x:Type entities:MenuSectionModel}"
14.                          ItemsSource="{Binding MenuItems}">
15.    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
16.        <StackPanel.ToolTip>
17.            <TextBlock Text="{Binding MenuSectionDescription}"
18.                          HorizontalAlignment="Stretch" />
19.        </StackPanel.ToolTip>
20.        <Image Source="{Binding IconData, Converter={StaticResource StrToImgConverter}}"
21.                        Height="32" Width="32"/>
22.        <TextBlock Text="{Binding MenuSectionText}"
23.                    VerticalAlignment="Center" HorizontalAlignment="Stretch"
24.                      Margin="6,0,0,0"/>
25.    </StackPanel>           
26.</HierarchicalDataTemplate>
27....
28.<telerik:RadPane Header="{Binding ApplicationData.ApplicationName, Mode=OneWay}"
29.     CanUserClose="False" CanFloat="False" CanDockInDocumentHost="False" >
30.    <telerik:RadPanelBar Height="Auto" HorizontalAlignment="Stretch"
31.         ExpandMode="Multiple"
32.             ItemsSource="{Binding ApplicationData.ApplicationMenu.MenuSections}"
33.             SelectionMode="Single"
34.             SelectedItem="{Binding SelectedMenuItem, Mode=OneWayToSource}">
35.     </telerik:RadPanelBar>
36.</telerik:RadPane>
Petar Mladenov
Telerik team
 answered on 15 Oct 2014
3 answers
498 views
Hi,

I'm trying to get the position of a context menu relative to his placement target by using MousePosition property and there is an issue.

Here's what I have :

<telerik:RadContextMenu>
    <telerik:RadMenuItem Header="Add item" Command="{Binging AddItemCommand}" CommandParameter="{Binding MousePosition, RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadContextMenu}}"/>
</telerik:RadContextMenu/>

When I click on "Add Item", the position that I received in the viewModel is (Double.NaN, Double.Nan), so I conclued that the value of MousePosition is updated after the evaluation of the bindings. Is there another way to get the MousePosition of the contextMenu that would works with MVVM ?

Thank you,

Etienne
Kalin
Telerik team
 answered on 15 Oct 2014
1 answer
308 views
Hi,

I have a RadTreeView where data is populated from an xml using XmlDataProvider.  I would like to bind the SelectedItem of TreeView to a ViewModel property of type string. When I do the binding using SelectedItem={Binding mydata}", the value mydata is set to System.Xml.XmlElement type.

I was able to find the logic to get the exact value. For testing purpose, I created a new TextBox control to retreive the exact selected data.

 <TextBox  DataContext="{Binding ElementName=ReportersTreeView, Path=SelectedItem}" Grid.Row="6"   Text="{Binding XPath=@Name}"></TextBox>

However in real scenario, I don't need this TextBox. 

I want to know how can I integrate this code to my tree view control such that XPath=@Name is correctly retrieved from SelectedItem  and set to my viewmodel property?

Below is my TreeView control and my Template.

 <HierarchicalDataTemplate x:Key="NodeTemplate">
            <TextBlock x:Name="tb"/>
            <HierarchicalDataTemplate.ItemsSource>
                <Binding XPath="child::node()" />
            </HierarchicalDataTemplate.ItemsSource>
            <HierarchicalDataTemplate.Triggers>
                <!--<DataTrigger Binding="{Binding Path=NodeType}" Value="Text">
                    <Setter TargetName="tb" Property="Text" Value="{Binding XPath = @name}"></Setter>
                </DataTrigger>-->
                <DataTrigger Binding="{Binding Path=NodeType}" Value="Element">
                    <Setter TargetName="tb" Property="Text" Value="{Binding Path=Attributes[Name].Value}"></Setter>
                </DataTrigger>
            </HierarchicalDataTemplate.Triggers>
        </HierarchicalDataTemplate>
        <XmlDataProvider x:Key="ReportersDataProvider" Source="ProbesTree.xml"
                         XPath="*">

 <telerik:RadTreeView Grid.Row="2"  IsDragDropEnabled="True" Name="ReportersTreeView"  SelectionMode="Single" IsSingleExpandPath="False" IsLineEnabled="True"   AutomationProperties.AutomationId ="ReportersTreeView" VerticalAlignment="Stretch"
                ItemTemplate= "{StaticResource NodeTemplate}" ItemsSource="{Binding Source={StaticResource ReportersDataProvider}}"  VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>

Please help.!!!!

Thanks,
Divya
         
Pavel R. Pavlov
Telerik team
 answered on 15 Oct 2014
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?