Telerik Forums
UI for WPF Forum
4 answers
252 views
Hello.
I'm using Q1 2010 for WPF.

I have this following simple sample:
<Window x:Class="sample.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telNavigationControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:telControlsControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
    xmlns:sample="clr-namespace:sample" 
    Title="Sample Window" Height="300" Width="300"
     
    <Window.Resources> 
 
        <Style x:Key="TelerikTabItemContainerStyle" TargetType="{x:Type telNavigationControls:RadTabItem}"
            <Setter Property="HeaderTemplate"
                <Setter.Value> 
                    <DataTemplate> 
                        <Button x:Name="closeButton" Content="Test Button" Height="25" sample:RoutedEventHelper.EnableRoutedClick="True"/> 
                    </DataTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
 
    </Window.Resources> 
     
    <Grid> 
        <telNavigationControls:RadTabControl x:Name="mainTabControl" ItemContainerStyle="{StaticResource TelerikTabItemContainerStyle}" > 
 
            <telNavigationControls:RadTabItem > 
                <telNavigationControls:RadTabItem.Content> 
                    <Button HorizontalAlignment="Center" VerticalAlignment="Center" Content="Test" IsDefault="True" /> 
                </telNavigationControls:RadTabItem.Content> 
            </telNavigationControls:RadTabItem> 
 
        </telNavigationControls:RadTabControl> 
    </Grid> 
</Window> 

As you can see, there is one RadTabControl with one RadTabItem. I've modified RadTabItem header through ItemContainerStyle. There is only one button in HeaderTemplate. I've used RoutedEventHandler class for allowing the button's click events to be catched.
Here is the code:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Windows; 
using System.Windows.Controls; 
 
using Telerik.Windows; 
using Telerik.Windows.Controls; 
 
namespace sample 
    class RoutedEventHelper 
    { 
        // TAB CLOSE BUTTON EVENT 
        public static readonly RoutedEvent TabCloseButtonPressedEvent = EventManager.RegisterRoutedEvent( 
            "TabCloseButtonPressed", 
            RoutingStrategy.Bubble, 
            typeof(RoutedEventHandler), 
            typeof(RoutedEventHelper)); 
 
        // DEPENDENCY PROPERTY FOR TAB ITEM HEADER BUTTON 
        public static readonly DependencyProperty EnableRoutedClickProperty = DependencyProperty.RegisterAttached( 
           "EnableRoutedClick", 
           typeof(bool), 
           typeof(RoutedEventHelper), 
           new PropertyMetadata(OnEnableRoutedClickChanged)); 
 
        // Add an attached property 
        public static bool GetEnableRoutedClick(DependencyObject obj) 
        { 
            return (bool)obj.GetValue(EnableRoutedClickProperty); 
        } 
 
        public static void SetEnableRoutedClick(DependencyObject obj, bool value) 
        { 
            obj.SetValue(EnableRoutedClickProperty, value); 
        } 
 
        // TAB EVENT HANDLER 
        private static void OnEnableRoutedClickChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) 
        { 
            var button = sender as Button; 
 
            if (button != null) 
                button.Click += CloseButton_Click; 
        } 
 
        private static void CloseButton_Click(object sender, RoutedEventArgs e) 
        { 
            var button = sender as Button; 
            if (button == null) return; 
 
            button.RaiseEvent(new RoutedEventArgs(TabCloseButtonPressedEvent, button)); 
        } 
    } 
 

Everything works fine with one exception. If I put another Button as RadTabItem Content (as you can see in the above xaml example) and I set property of this button "IsDefault = true", the click events from the first button in RadTabItem header are not fired.
Is this behavior correct ?

I have also second question:
Imagine almost the same situation as in the previous example. I've RadTabItem with modified HeaderTemplate with one button in it. I've no buttons in the RadTabItem Content, so when I click on Button in my RadTabItem header, the click event is fired correctly. 
Let's continue. Now I've got for example two RadTabItems (with the same HeaderTemplate) in one RadTabControl. The first RadTabItem is selected, the second one not. And now here it comes. When I click on the button (button in RadTabItem header) in the RadTabItem which is NOT selected, the event is not fired, only this specified RadTabItem becomes selected. So the click events are fired only when the RadTabItem is Selected.

The following behavior would be best for me: When I click on the button in header of arbitrary RadTabItem (selected or not) the click event of the button will be fired but the selection of the RadTabItems will NOT changed.

Is this scenario possible ? Or it would be great if at least the event of the buttons will be fired no matter the RadTabItem is selected or not.

Thank you a lot.

Stefan.



Ivan
Telerik team
 answered on 06 May 2010
1 answer
257 views
I've a window with a listbox on the left half and a listview on the right half. The DataTemplate of the listview is set to a template which contains a listbox, so for every row of the listview a new listbox is created. Now I want to drag an item from the left half of the window into one of the nested listboxes on the right half. The problem is, that the nested listboxes aren't registered as drop target zones, although the AllowDrop-prop is set to true. If I set the AllowDrop-Property of the listview to true, the DropQuery-Event is raised, but the e.Options.Destination is always the listview, not the listbox inside it.

Any help is appreciated.

Thanks

Patrick


Tina Stancheva
Telerik team
 answered on 05 May 2010
1 answer
130 views
Hi,

In my application, I am showing a GridView with a Child Table.
As there a quite a lot of items in the GridView, I want the row height as low as possible.
When i set the row height in my grid, either by setting the RowStyle or by using a RowStyleSelector, my child table isn't shown anymore when i try to expand it.

Is there any other way of decreasing the rowheight of my GridView but still allow the Child Table to be shown?

Thanks,

Hans
Yordanka
Telerik team
 answered on 05 May 2010
2 answers
113 views
Hello!
Is there the possibility to have the NumericUpDown component having only values that are powers of 10.
Like 0.001; 0.01; 0.1; 1; 10; 100 etc 

Thank you!
Roxana C
RoxanaC
Top achievements
Rank 1
 answered on 05 May 2010
3 answers
177 views
Hello.

I have simple application. In this application is one RadTabControl with twor RadTabItems and in both are RadDockings with one RadPane in each. Here is the code:
<Grid> 
        <telNavigationControls:RadTabControl x:Name="mainTabControl" Grid.Row="0" HorizontalAlignment="Stretch" 
                VerticalAlignment="Stretch" DisplayMemberPath="Content" DropDownDisplayMode="Collapsed" ScrollMode="Viewport"  
                Background="#dde1ea" telControlsControls:StyleManager.Theme="Windows7" SnapsToDevicePixels="True" SelectedIndex="0"
 
            <!--FIRST TAB ITEM--> 
            <telNavigationControls:RadTabItem Header="Tab 1"
                <telNavigationControls:RadTabItem.Content> 
                    <telDockingControls:RadDocking HasDocumentHost="False"
                        <telDockingControls:RadSplitContainer > 
                            <telDockingControls:RadPaneGroup > 
                                <telDockingControls:RadPane Title="Tab1" Style="{StaticResource TelerikRadPaneStyle}"/> 
                            </telDockingControls:RadPaneGroup> 
                        </telDockingControls:RadSplitContainer> 
                    </telDockingControls:RadDocking> 
                </telNavigationControls:RadTabItem.Content> 
            </telNavigationControls:RadTabItem> 
 
            <!--SECOND TAB ITEM--> 
            <telNavigationControls:RadTabItem Header="Tab 2"
                <telNavigationControls:RadTabItem.Content > 
                    <telDockingControls:RadDocking HasDocumentHost="False"
                        <telDockingControls:RadSplitContainer > 
                            <telDockingControls:RadPaneGroup > 
                                <telDockingControls:RadPane Title="Tab2" Style="{StaticResource TelerikRadPaneStyle}"/> 
                            </telDockingControls:RadPaneGroup> 
                        </telDockingControls:RadSplitContainer> 
                    </telDockingControls:RadDocking> 
                </telNavigationControls:RadTabItem.Content> 
            </telNavigationControls:RadTabItem> 
        </telNavigationControls:RadTabControl> 
 
    </Grid> 

On each RadPane is applied simple Style, which changes also the TitleTemplate. Here is it:
 <Style x:Key="TelerikRadPaneStyle" TargetType="{x:Type telDockingControls:RadPane}"
            <Setter Property="CanUserPin" Value="False" /> 
            <Setter Property="CanFloat" Value="True" /> 
            <Setter Property="CanUserClose" Value="False" /> 
            <Setter Property="ContextMenuTemplate"
                <Setter.Value> 
                    <DataTemplate> 
                        <telNavigationControls:RadContextMenu Visibility="Collapsed" /> 
                    </DataTemplate> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="TitleTemplate"
                <Setter.Value> 
                    <DataTemplate > 
                        <Grid > 
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="Auto" /> 
                            </Grid.ColumnDefinitions> 
                            <Button Grid.Column="0" Width="100" Content="Test Button" HorizontalAlignment="Center"/> 
                        </Grid> 
                    </DataTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 

And here is the problem. When I start my application, the first RadPane in first RadTabItem is with applied style, but when I select second RadTabItem, the RadPane in this item is withou applied style.

Can you please tell me where is the problem or what I'm doing wrong ?

Thank You.

Stefan.



Miroslav Nedyalkov
Telerik team
 answered on 05 May 2010
4 answers
247 views
I want to have 2 panes, one larger than the other with a split vertically. I was these panes to be stretched to the size of their container, in this case a grid row. So I have this

        <telerikDocking:RadDocking x:Name="radDocking" Grid.Row="2">
            <telerikDocking:RadSplitContainer InitialPosition="DockedTop" Orientation="Horizontal" VerticalAlignment="Stretch">
                <telerikDocking:RadPaneGroup telerikDocking:ProportionalStackPanel.RelativeSize="200, 200">
                    <telerikDocking:RadPane Header="pane" />
                </telerikDocking:RadPaneGroup>
                <telerikDocking:RadPaneGroup telerikDocking:ProportionalStackPanel.RelativeSize="400, 200">
                    <telerikDocking:RadPane Header="pane" />
                </telerikDocking:RadPaneGroup>
            </telerikDocking:RadSplitContainer>
        </telerikDocking:RadDocking>

However, this doesn't stretch to the grid row height. How can I get this to happen?

Thanks
Miroslav Nedyalkov
Telerik team
 answered on 05 May 2010
1 answer
89 views
I have an MVVM application

View contain:
<telerik:InformationLayer x:Name="informationLayer"  > 
   <Border  
        telerik:MapLayer.Location="{Binding Path=LocationData.CurrentLocation}"  
    Background="#00FFFFFF">..... 

ViewModel contain:
public Location CurrentLocation 
    get 
    { 
         return panel.CurrentLocation; 
    } 
    private set  
    { 
         panel.CurrentLocation = value; 
         OnPropertyChanged("CurrentLocation"); 
    } 

If i start app and change CurrentLocation value binding works normally,
but if before it move map bindnig dies..

???

PS work with RadControls for WPF 2010 1 0422
Andrey
Telerik team
 answered on 05 May 2010
3 answers
231 views
I am looking for a 3D Bar Chart control, where multiple data series can be plotted at a different Z axis value. There is a sample example available on CodeProject: http://www.codeproje...t_control.aspx.

The solution addresses what I need, but I was wondering if Telerik has an equivalent solution (With better look and feel).

I didn't see anything similar to this in the sample browser. I wanted to know if I can achieve something similar from current offering. If not do you plan to add something similar in near future?
Velin
Telerik team
 answered on 05 May 2010
1 answer
266 views
Hello,
      I just recently started using Telerik controls for WPF and to be honest have found the documentation to be quite disorganized. It seems that everything wants to take you back to the demo project, which offers nothing but a sample of what the control CAN do, not how to do it, weird.....anyways, I am trying to do something very simple, which is to change the colors of the bars on a bar graph, or more generally, the colors of the lines on any type of graph. I have the graph working, it is data bound, and it looks great, but the default color of the bars make the graph blend in too much to the rest of the interface. Any suggestions?  It seems like is should be a simple property of the graph, but I cannot find it.
Velin
Telerik team
 answered on 05 May 2010
3 answers
114 views
This seems like a pretty simple request so I am hoping there is an easy way to satisfy it.  Can we easily change the text of the insert new row label?  I believe it starts out as insert new record or something along those lines and we would like to change the text to something else.  Is this easily possible?
Milan
Telerik team
 answered on 05 May 2010
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
DataPager
PersistenceFramework
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?