Telerik Forums
UI for WPF Forum
0 answers
116 views
Hi
I have a gridview in my usercontrol, now I need to specify position of insert new row programmatically
I see some solution base on using template in xaml file, but I need to set it in code Based on user settings.
is there anyone familiar with this?
farsica
Top achievements
Rank 1
 asked on 15 Dec 2011
1 answer
94 views
I'm seeing something in the Q3 release that was not seen in the Q2 release. I have two Panes that dock like tool windows on the left side of the main window. One Pane is hidden behind the other when the app starts and two tabs are shown below the Panes. When I click the tab for the hidden window, it now requires two clicks where it used to require only one. Once the tab has been activated, a single click is sufficient to switch back and forth between the Panes.

The major portion of my view xaml is attached below in the hopes that it may answer why I am seeing this behavior.

<telerik:RadDocking PreviewShowCompass="RadDocking_PreviewShowCompass" Close="RadDocking_OnClose" PreviewClose="RadDocking_OnPreviewClose" Background="{x:Null}">
 
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer >
            <telerik:RadPaneGroup Name="_rpanegroupDocuments" />
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
 
    <telerik:RadSplitContainer >
        <telerik:RadPaneGroup Name="_rpanegroupTools">
 
            <telerik:RadPane Header="Connections" CanUserClose="False" Name="_rpaneConnections" ContextMenuTemplate="{x:Null}" CanDockInDocumentHost="False">
                <myToolWindows:ConnectionsPaneView DataContext="{Binding ConnectionsPaneViewModel}" />
            </telerik:RadPane>
 
            <telerik:RadPane Header="Actions" CanUserClose="False" Name="_rpaneActions" ContextMenuTemplate="{x:Null}" CanDockInDocumentHost="False" >
                <myToolWindows:ActionsPaneView DataContext="{Binding ActionsPaneViewModel}" />
            </telerik:RadPane>
 
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
 
    <telerik:RadSplitContainer InitialPosition="DockedBottom">
        <telerik:RadPaneGroup Name="_rpanegroupOutput" AllowDrop="False">
 
            <telerik:RadPane Header="Output" CanUserClose="False" Name="_rpaneOutput" ContextMenuTemplate="{x:Null}" CanDockInDocumentHost="False">
                <myToolWindows:OutputPaneView DataContext="{Binding OutputPaneViewModel}" />
            </telerik:RadPane>
 
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
 
</telerik:RadDocking>
Boyan
Telerik team
 answered on 15 Dec 2011
1 answer
66 views
The behavior of the RadPanelBarItem has changed in the Q3 release. It is now sizing to the content rather than the container. The result is a horizontally and vertically compressed set of bars when they are all closed. The width of all items will change according to the widest width of the open elements. The horizontal behavior no longer fills the vertical dimension.

Some drag/drop operations broke in the Q2 release and I was hoping to get them working in Q3. It looks like I need to do more to get this working in Q3, but now I've got a new issue in the Q3 release. I appreciate Telerik's efforts to push new content out in each Q release, but is Telerik allowing these regressions in order to push content? Some of these issues, such as this RadPanelBarItem issue, seem like something that would be pretty hard to miss in testing. If so, then we won't have a chance of reaching stability.

This post is similar to the preceding but that post related the issue to themes. I think the more general characterization should help others find this issue faster. If the forum moderator chooses to remove this post, I will understand.

Edit: Here is a workaround:

        <telerik:RadPanelBarItem Header="Full Width PanelBarItem" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadPanelBar}}, Path=ActualWidth}">
.
.
.
        </telerik:RadPanelBarItem>

Set any one of the PanelBarItem widths to that of the parent PanelBar and all widths will follow the width of the PanelBar. Leaving the vertical problem for later.
Petar Mladenov
Telerik team
 answered on 15 Dec 2011
1 answer
123 views
I have a custom selection box template for a RadComboBox containing buttons, and then I handle the click events of those buttons to set values in my data.  This previously worked, but I just installed the latest version of the RadControls and now it doesn't work anymore, events don't seem to get routed to the buttons inside the combo box anymore, the combo box eats all the focus and click events itself without passing them on.

I made a simple test app to show this happening, you'll notice when an item is selected, the buttons inside the combo box can't get focus and can't be clicked.

<Window x:Class="RadControlsTest.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    <Window.Resources>
        <DataTemplate x:Key="ComboBoxSelectionBoxTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                 
                <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Text="{Binding TestData1}" FontSize="18.667" FontWeight="Bold" FontStyle="Italic"/>
                <Separator Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="5" />
                <TextBlock Grid.Row="2" Grid.Column="0" Text="TestText1" HorizontalAlignment="Center" Margin="3,3,3,0" />
                <TextBlock Grid.Row="2" Grid.Column="1" Text="TestText2" HorizontalAlignment="Center" Margin="3,3,3,0" />
                <TextBlock Grid.Row="2" Grid.Column="2" Text="TestText3" HorizontalAlignment="Center" Margin="3,3,3,0" />
                <TextBlock Grid.Row="2" Grid.Column="3" Text="TestText4" HorizontalAlignment="Center" Margin="3,3,3,0" />
                <TextBlock Grid.Row="2" Grid.Column="4" Text="TestText5" HorizontalAlignment="Center" Margin="3,3,3,0" />
                <telerik:RadButton Grid.Row="3" Grid.Column="0" Tag="0" Focusable="False" telerik:StyleManager.Theme="Office_Silver" Content="Button1" Click="ComboButton_Click" Margin="3" HorizontalAlignment="Center"/>
                <telerik:RadButton Grid.Row="3" Grid.Column="1" Tag="1" Focusable="False" telerik:StyleManager.Theme="Office_Silver" Content="Button1" Click="ComboButton_Click" Margin="3" HorizontalAlignment="Center"/>
                <telerik:RadButton Grid.Row="3" Grid.Column="2" Tag="2" Focusable="False" telerik:StyleManager.Theme="Office_Silver" Content="Button1" Click="ComboButton_Click" Margin="3" HorizontalAlignment="Center"/>
                <telerik:RadButton Grid.Row="3" Grid.Column="3" Tag="3" Focusable="False" telerik:StyleManager.Theme="Office_Silver" Content="Button1" Click="ComboButton_Click" Margin="3" HorizontalAlignment="Center"/>
                <telerik:RadButton Grid.Row="3" Grid.Column="4" Tag="4" Focusable="False" telerik:StyleManager.Theme="Office_Silver" Content="Button1" Click="ComboButton_Click" Margin="3" HorizontalAlignment="Center"/>
            </Grid>
        </DataTemplate>
    </Window.Resources>
        <Grid>
            <telerik:RadComboBox x:Name="TestComboBox" Margin="15,10" SelectionBoxTemplate="{StaticResource ComboBoxSelectionBoxTemplate}" Height="100" Width="320" />
        </Grid>
</Window>



And the relevant C# code for the main window

public class TestData
{
    public TestData(string test1) { TestData1 = test1; }
 
    public string TestData1 { get; set; }
}
 
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    List<TestData> m_TestDataList = new List<TestData>();
     
    public MainWindow()
    {
        m_TestDataList.Add(new TestData("test1"));
        m_TestDataList.Add(new TestData("test2"));
        m_TestDataList.Add(new TestData("test3"));
        m_TestDataList.Add(new TestData("test4"));
         
        InitializeComponent();
    }
 
    private void ComboButton_Click(object sender, System.Windows.RoutedEventArgs e)
    {
        Button comboButton = (Button)sender;
        int index = (int)comboButton.Tag;
 
        MessageBox.Show("Clicked button " + index.ToString());
    }
 
    private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
    {
        TestComboBox.ItemsSource = m_TestDataList;
        TestComboBox.DisplayMemberPath = "TestData1";
    }
}
Valeri Hristov
Telerik team
 answered on 15 Dec 2011
1 answer
218 views

im having a problem with templates it seems that only the first template is used not the cascaded if i use datatemplateselector it is ignored ( SelectTemplate is never called )

im quite new so maybee im doing something wron if you need more help please contact me

Edit: the ItemSource handling is correct and currentItem is also fine just the visual tree of the nested templates are ignored and this obviously results in binding errors

cheers jan

<

 

 

UserControl

xmlns

 

 

="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns

 

 

:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns

 

 

:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns

 

 

:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns

 

 

:local="clr-namespace:LibaryTest" xmlns:ViewModel="clr-namespace:LibaryTest.ViewModel"

xmlns

 

 

:View="clr-namespace:LibaryTest.View" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

xmlns

 

 

:Breadcrumb="clr-namespace:Telerik.Windows.Controls.Breadcrumb;assembly=Telerik.Windows.Controls.Navigation"

mc

 

 

:Ignorable="d"

x

 

 

:Class="LibaryTest.View.ProductionDetailView"

x

 

 

:Name="UserControl"

d

 

 

:DesignWidth="300" d:DesignHeight="240">

 

 

<UserControl.Resources>

 

 

<HierarchicalDataTemplate x:Key="ScheduleTemplate">

 

 

<TextBlock Text="{Binding DomainObject.ScheduleName}" />

 

 

</HierarchicalDataTemplate>

 

 

<HierarchicalDataTemplate x:Key="RunTemplate" ItemsSource="{Binding ProductionSchedules}" ItemTemplate="{StaticResource ScheduleTemplate}" >

 

 

<TextBlock Text="{Binding DomainObject.RunName}" />

 

 

</HierarchicalDataTemplate>

 

 

<HierarchicalDataTemplate x:Key="ProductionTemplate" ItemsSource="{Binding ProductionSchedules}" ItemTemplate="{StaticResource RunTemplate}" >

 

 

<TextBlock Text="{Binding DomainObject.ProductionName}" />

 

 

</HierarchicalDataTemplate>

 

 

<View:NavigationDetailTemplateSelector x:Key="detailSelector"/>

 

 

<View:NavigationMasterTemplateSelector x:Key="masterSelector"/>

 

 

</UserControl.Resources>

 

 

<d:DataContext>

 

 

<ViewModel:ProductProductionViewModel />

 

 

</d:DataContext>

 

 

<Grid x:Name="LayoutRoot">

 

 

<Grid.RowDefinitions>

 

 

<RowDefinition Height="0.05*"/>

 

 

<RowDefinition Height="0.95*"/>

 

 

</Grid.RowDefinitions>

 

 

<telerik:RadBreadcrumb x:Name="navigationView"

 

Header="{Binding}"

 

Grid.Row="0"

 

ItemTemplate="{DynamicResource ProductionTemplate}"

 

ItemsSource="{Binding ProductProductionRuns}"

 

IsTextModeEnabled="False"

 

/>

 

 

<!--

ItemTemplateSelector="{DynamicResource masterSelector}"

HeaderTemplateSelector="{DynamicResource masterSelector}"

HeaderTemplate="{DynamicResource RunTemplate}"

ItemTemplate="{DynamicResource ProductionTemplate}"

HeaderTemplate="{DynamicResource ProductionTemplate}"

<TreeView x:Name="navigationView" ItemsSource="{Binding ProductProductionRuns}" Grid.Row="0" ItemTemplate="{DynamicResource RunTemplate}" />

-->

 

 

<!--

this is working fine

<ContentControl x:Name="DetailView"

DataContext="{Binding CurrentItem, ElementName=navigationView}"

ContentTemplateSelector="{DynamicResource detailSelector}"

Grid.Row="1"

Content="{Binding DataContext, RelativeSource={RelativeSource Self}}" >

</ContentControl>-->

 

 

 

 

</Grid>

</

 

 

UserControl>

Zarko
Telerik team
 answered on 15 Dec 2011
1 answer
304 views
I have a model class, Folder:

public class Folder
{
    public string Name { get; set; }
    public ObservableCollection<Folder> SubFolders { get; set; }
}

This is exposed to the UI via a view model, the the folder structure is displayed in a RadTreeView using a hierarchical data template and all is well.

I am adding a context menu to each Folder in the tree view, one of the options on the menu is "Rename". When this is clicked, I want the relevant RadTreeViewItem to go into edit mode.

I can add an "IsInEditMode" flag to the Folder, that's not a problem. The Command on the menu item is bound to the command on the view model, and I can get hold of the relevant Folder using a command parameter, that's not a problem.

But how to I set the IsEditable on the hierarchical data template? And how do I bind the IsInEditMode of the TreeViewItem to that of the Folder? Here is my current XAML (which shows a few other things, like a similar structure with the Tag objects:

<telerik:RadTreeView DockPanel.Dock="Top">
    <telerik:RadTreeViewItem Header="My Folders" ItemsSource="{Binding Folders}">
        <telerik:RadTreeViewItem.ItemTemplate>
            <HierarchicalDataTemplate ItemsSource="{Binding SubFolders}" DataType="{x:Type Model:Folder}">                                   
                <TextBlock Text="{Binding Name}" />
            </HierarchicalDataTemplate>
        </telerik:RadTreeViewItem.ItemTemplate>
    </telerik:RadTreeViewItem>
</telerik:RadTreeView>
 
<telerik:RadTreeView DockPanel.Dock="Top">
    <telerik:RadTreeViewItem Header="My Tags" ItemsSource="{Binding Tags}">
        <telerik:RadTreeViewItem.ItemTemplate>
            <HierarchicalDataTemplate ItemsSource="{Binding SubTags}" DataType="{x:Type Model:Tag}">
                <TextBlock Text="{Binding Name}" >
                <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu>
                    <telerik:RadMenuItem Header="Rename" Command="{StaticResource renameTagCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=DataContext}"/>
                    <telerik:RadMenuItem Header="Delete Tag"/>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
                </TextBlock>
            </HierarchicalDataTemplate>
        </telerik:RadTreeViewItem.ItemTemplate>
    </telerik:RadTreeViewItem>

Open to other suggestions. Cheers.
Petar Mladenov
Telerik team
 answered on 15 Dec 2011
1 answer
90 views
I'm using RadChart 2011 Q3. I have a chart with two lines series on it. I would like to add two separate grid lines and shade the area in between. I know how to add the grid lines. But I don't know how (or if it's possible) to shade the entire area between the two grid lines.

Thank you!
Sia
Telerik team
 answered on 15 Dec 2011
1 answer
63 views
Hello,

as stated in this article (http://www.telerik.com/help/wpf/radscheduleview-migration-from-radscheduler.html) the old radscheduler had an property called "AppointmentEditAction" in the AppointmentEditingEventArgs where you could get the type of edit action such as edit, drag or resize. This property is not present in RadScheduleView. However i subscribed to the appointment editing event and i need to act differently on it regarding the edit action such as edit, drag or resize. Is there a way on how i can get the information of what type the edit event is?

thanks in advance

best regards

Matthias
Yana
Telerik team
 answered on 15 Dec 2011
4 answers
106 views
Does anyone have any articles or example code were drag drop functionality has been implemented between a surfacelistbox and radscheduleview in WPF? Thanks a lot.
Daniel
Top achievements
Rank 1
 answered on 15 Dec 2011
1 answer
150 views
Is there an easy way to change the icon on the TimePicker control?  I looked and couldn't find a quick property to set (e.g. IconPath="MyImage.png" or something).
Dani
Telerik team
 answered on 15 Dec 2011
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?