Telerik Forums
UI for WPF Forum
1 answer
218 views
Hi,

I have a RadDocumentPane (same for RadPane) with the HeaderTemplate that has a DataTemplate as a static resource. Binding works fine with dock/undock. The issue comes in when RadDocking.LoadLayout is called. The binding is lost on the DocumentHeader (text for header).  There is no problem with the Tooltip binding on the RadDocking.LoadLayout. Can someone assist?

Thanks

<DataTemplate x:Key="RadPaneHeaderTemplate" DataType="{x:Type telerikDocking:RadPane}">
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="{Binding}" ToolTip="{Binding ElementName=DocumentPane, Path=Tag, Mode=OneWay}"/>
    </StackPanel>
</DataTemplate>

 

<telerikDocking:RadDocumentPane x:Name="DocumentPane"
                                                     HeaderTemplate="{StaticResource RadPaneHeaderTemplate}" Header="{Binding Path=DocumentHeader}"
                                                     Tag="{Binding Path=DocumentToolTip}"
                                                     telerikDocking:RadDocking.SerializationTag="DocumentPane"                                                       
                                                     HorizontalContentAlignment="Left" CanUserClose="False"
                                                     DataContext="{Binding}" >

Georgi
Telerik team
 answered on 15 Aug 2012
1 answer
121 views
Hello,

I have a Gridview with many columns and 4 Groups
i have troubles with the group funktion.
After loading empty Gridview, groups are ok, but after adding rows to the grid 3rd groups has only 2 Entries(schould be 13)
See attached screenshots
The user can reorder the columns, then the groups are ok again.
Yoan
Telerik team
 answered on 15 Aug 2012
1 answer
570 views
We are implementing the RadDocking with just one Toolbar (splitcontainer with radpanegroup with one radpane...see XAML later in post). It is Docked Left and starts out Unpinned.

When you click on the AutoHideArea tab for the Toolbar it opens just fine but never AutoHides even when I move the mouse over and click on the main document area.

The documentation on http://www.telerik.com/help/wpf/raddocking-panes-pinned-unpinned-panes.html says:

"The unpinned RadPane is shown only when the mouse cursor is over it and is hidden when the cursor leaves its area."

This is clearly not happening.  In fact, I loaded the "Getting Started" example in this same documentation section and it does not occur there either.  Either I am missing something or something is broken (or the documentation is wrong)

That is Question 1: Why does the unpinned RadPane not hide when the cursor leaves its area?

Question 2:

XAML is below.  In the code, the c:TabControl shown is just a wrapper for a RadTabControl.  After some work I figured out that it is probably because my control is directly in the DocumentHost.  I did this because I do not want a splitcontainer or pane header.  I just want my own control in the main area.  In addition, our tabcontrol relies on an override of RadTabControl.OnApplyTemplate() getting fired when RadDocking performs its MeasureOverride(), which does not happen when I put our control inside these new panes.

Maybe I just need to know how to ensure my OnApplyTemplate() override gets fired when RadDocking performs its MeasureOverride() but then I would also need to know how to hide the Pane header I suppose.

Thanks for any help.

<telerik:RadDocking  telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True">
            <telerik:RadDocking.RootCompassStyle>
                <Style TargetType="telerik:RootCompass">
                    <Setter Property="IsCenterIndicatorVisible" Value="False" />
                    <Setter Property="IsTopIndicatorVisible" Value="False" />
                    <Setter Property="IsBottomIndicatorVisible" Value="False" />
                </Style>
                </telerik:RadDocking.RootCompassStyle>
            <telerik:RadDocking.CompassStyle>
                <Style TargetType="telerik:Compass">
                    <Setter Property="IsCenterIndicatorVisible" Value="False" />
                    <Setter Property="IsTopIndicatorVisible" Value="False" />
                    <Setter Property="IsBottomIndicatorVisible" Value="False" />
                </Style>
            </telerik:RadDocking.CompassStyle>
            <telerik:RadDocking.DocumentHost>
                <telerik:RadBusyIndicator IsBusy="{Binding LayoutLoaded,Converter={StaticResource BooleanInverter}}"
                                  DockPanel.Dock="Left"
                                  BusyContent="Loading Layout..."
                                  IsIndeterminate="True">
                <c:TabControlEx x:Name="ItemTabControl"
                            ItemsSource="{Binding Tabs}"
                            SelectedItem="{Binding ActiveTab}"
                            Loaded="ItemTabControl_Loaded"
                            Padding="0"
                            Style="{StaticResource BlueTabControlEx}"/>
                </telerik:RadBusyIndicator>
            </telerik:RadDocking.DocumentHost>
 
            <telerik:RadSplitContainer InitialPosition="DockedLeft" Width="285">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Toolbox" IsPinned="False">
                        <v:NewToolboxView BorderBrush="#385d8a" BorderThickness="2" DataContext="{Binding Toolbox}"/>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
Konstantina
Telerik team
 answered on 15 Aug 2012
1 answer
115 views
Hey,

I found a simple to reproduce bug.  When I have task A with children B and C, C with children D and E and E with children F.  I want to move D and E so their parents are A instead of C.  D works fine but E does not because it has children. This seems like this control was designed so tasks should never be moved, with the amount of problems that it causes.... Below is the full code, I am using 2012 Q2 on wpf.
Thanks,
Eric

using System;
using System.Windows;
 
namespace Scratch
{
    using System.Collections.ObjectModel;
 
    using Telerik.Windows.Controls.GanttView;
    using Telerik.Windows.Controls.Scheduling;
 
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            var ts = new ObservableCollection<IGanttTask>();
            gantt.VisibleRange = new DateRange(DateTime.Now.AddMinutes(0), DateTime.Now.AddMinutes(6));
            gantt.PixelLength = new TimeSpan(0,0,0,1);
            gantt.TasksSource = ts;
            var a = new GanttTask { Start = DateTime.Now.AddMinutes(0), End = DateTime.Now.AddMinutes(6), Title = "A" };
            var b = new GanttTask { Start = DateTime.Now.AddMinutes(0), End = DateTime.Now.AddMinutes(1), Title = "B" };
            var c = new GanttTask { Start = DateTime.Now.AddMinutes(2), End = DateTime.Now.AddMinutes(6), Title = "C" };
            var d = new GanttTask { Start = DateTime.Now.AddMinutes(2), End = DateTime.Now.AddMinutes(3), Title = "D" };
            var e = new GanttTask { Start = DateTime.Now.AddMinutes(4), End = DateTime.Now.AddMinutes(6), Title = "E" };
            var f = new GanttTask { Start = DateTime.Now.AddMinutes(5), End = DateTime.Now.AddMinutes(6), Title = "F" };
            ts.Add(a);
            a.Children.Add(b);
            a.Children.Add(c);
            c.Children.Add(d);
            c.Children.Add(e);
            e.Children.Add(f);
 
            // The error occours In the below lines (when E is moved)
            c.Children.Remove(d);
            a.Children.Add(d);
            c.Children.Remove(e);
            a.Children.Add(e);
        }
    }
}
<Window x:Class="Scratch.MainWindow"
        xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GanttView"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Controls:RadGanttView x:Name="gantt"/>
    </Grid>
</Window>

Ventzi
Telerik team
 answered on 15 Aug 2012
2 answers
126 views
Hey,

I'm on a roll tonight! (This may be related to the other one)  Let's say I have directory A, which has children B,C,D,E,F,G.  B has children H,I,J. C  has a child K.  First I delete B by doing A.Children.Remove(B).  Then I move K to have A as a parent: C.Children.Remove(K). A.Children.Add(K).  Now it thinks you've added K twice, and it barfs at you.  After a few hours of poking through your code, I found this is because the internal Index of C was messed up after I removed B.  So when I tried to remove C, it remved the wrong item! I think this is because the code is forgetting that it is also removing children when it removes tasks with children...  Specificly, I think (might be wrong here) that the code in HierarchicalCollectionAdapterBase is not taking this into account (see below).  I should be able to make a simple program to show this bug if nessesary.  Probably what I will end up doing is the DFS myself to hierarchicly remove each item I need to....

Eric
As always, using 2012 Q2 wpf
var startIndex = collectionChangedAction == NotifyCollectionChangedAction.Remove ? oldStartingIndex : newStartingIndex;
 
                var newWrappers = newItemsCollection != null ? newItemsCollection.OfType<HierarchicalItem>() : Enumerable.Empty<HierarchicalItem>();               
                var newItemsCount = newItemsCollection != null ? newItemsCollection.Count : 0;
 
                var oldWrappers = oldItemsCollection != null ? oldItemsCollection.OfType<HierarchicalItem>() : Enumerable.Empty<HierarchicalItem>();
                var oldItemsCount = oldItemsCollection != null ? oldItemsCollection.Count : 0;
 
                var removedWrappers = oldWrappers.SelectMany(Flatten).ToArray();
                var addedWrappers = newWrappers.SelectMany(Flatten).ToArray();
                 
                var sourceCollectionItemsCountDifference = newItemsCount - oldItemsCount;
                var childrenCountDifference = addedWrappers.Length - removedWrappers.Length - sourceCollectionItemsCountDifference;
 
                for (int i = startIndex + newItemsCount; i < targetCollection.Count; i++)
                {
                    targetCollection[i].previousChildrenCount += childrenCountDifference;
                    targetCollection[i].SourceItemIndex += sourceCollectionItemsCountDifference;
                }
 
                var previousChildrenCount = startIndex > 0 ? targetCollection[startIndex - 1].previousChildrenCount + targetCollection[startIndex - 1].visibleChildrenCount : 0;
 
                foreach (var newWrapper in newWrappers)
                {
                    newWrapper.previousChildrenCount += previousChildrenCount;
                    previousChildrenCount += newWrapper.visibleChildrenCount;
                }
Ventzi
Telerik team
 answered on 15 Aug 2012
2 answers
250 views
Are there any example showing how to draw a red wavy line under a set of text?

In my project, I use a lot of custom annotations. The annotions have a DateTime property that is used to flag up an expiry time limit.
I would like a red wavy line to appear under the text in the custom annotation when the expirey time period has elapsed.

I've already used custom presentation to draw rectangles around certain annotations:

Rectangle rectangle = new Rectangle();
rectangle.Width = Math.Max(0, (endInline.BoundingRectangle.Location.X - startInline.BoundingRectangle.Location.X));
rectangle.Height = startInline.LineInfo.Height;
 
Canvas.SetTop(rectangle, startInline.ControlBoundingRectangle.Top - (startInline.LineInfo.Height / 1.5));
Canvas.SetLeft(rectangle, startInline.BoundingRectangle.Left);
 
rectangle.Fill = FillBrush;
rectangle.Opacity = MouseOverHighlightLayer.MouseOutOpacity;
rectangle.MouseEnter += (s, e) => { ((Rectangle)s).Opacity = MouseOverHighlightLayer.MouseInOpacity; };
rectangle.MouseLeave += (s, e) => { ((Rectangle)s).Opacity = MouseOverHighlightLayer.MouseOutOpacity; };

I'm mainly looking for the best way to draw a red wavy line.

Thank you very much for your time and help,

Rob
Iva Toteva
Telerik team
 answered on 15 Aug 2012
2 answers
393 views
Hi,

Is there a way to only allow one expander to be expanded? I have a group of expanders and I want only one expander expanded at a time.

Thanks,
Mark
Mark
Top achievements
Rank 1
 answered on 15 Aug 2012
2 answers
477 views
Hi all,

I am having trouble with trying to bind the x-value for a ScatterPointSeries to DateTime variable. The chart is based on live data, so I know that the data binding in general is working because the Y-axis is adjusting correctly. However, no tick marks are showing up for the X-axis, and thus no scatter points are showing up on the graph. Below is the code snippet for the dynamic data binding.

def = new ScatterPointSeries()
                    {
                        XValueBinding = new PropertyNameDataPointBinding("Time"),
                        YValueBinding = new PropertyNameDataPointBinding("Value")
                         
                    };
...
(def as ScatterPointSeries).PointTemplate = (DataTemplate)System.Windows.Markup.XamlReader.Parse(
                        @"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
                        <Ellipse Width=""5"" Height=""5"" Fill=""" + BrushColor.ToString() + @""" Opacity=""" + WPConstants.DEFAULT_LINE_FILL_OPACITY + @"""/>
                        </DataTemplate>");


Thanks,
Jin
Petar Kirov
Telerik team
 answered on 14 Aug 2012
8 answers
112 views

Dragging and dropping works great on my development machine, but when I move the application to a client machine and try to drag, the drag object apears briefly then disapears as I move the mouse.  The two machines are running the same operating system.  Is there something Im missing to stop this from happening?  The only difference between machines is on my development one I have the Telerik tools installed and on the client machine I am running the Telerik dlls from a folder.

thanks for any help,
Bryan
Bryan
Top achievements
Rank 1
 answered on 14 Aug 2012
2 answers
130 views
Using drag and drop on screen whose display is set to 120 DPI offset the drag cue.  The drag cue is positioned away from the mouse and gradually moves further away as the mouse moves around the screen.  To reporduce this issue run the drag and drop example in the WPF examples, and set DPI to 120 and see the offset position of the drag cue.  Is there a fix for this?

thanks,
Bryan
Bryan
Top achievements
Rank 1
 answered on 14 Aug 2012
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?