Telerik Forums
UI for WPF Forum
1 answer
177 views
Hello,

i am trying to resize a radPane to fit its content when it's state changed to floating. I read in this forum that i should get the parent window and set the size of the parent toolwindow manually, but i cannot compile it:

'TelerikRadPaneTest.CustomPane' does not contain a definition for 'GetParentToolWindow' and no extension method 'GetParentToolWindow' accepting a first argument of type 'TelerikRadPaneTest.CustomPane' could be found (are you missing a using directive or an assembly reference?)



According to the official API the method should be in the assembly i am using:
2012.3.1129.40 Telerik.Windows.Controls
2012.3.1129.40 Telerik.Windows.Controls.Data
2012.3.1129.40 Telerik.Controls.Docking
2012.3.1129.40 Telerik.Controls.Navigation


MainWindow.xaml

<Window x:Class="TelerikRadPaneTest.MainWindow"
        xmlns:c="clr-namespace:TelerikRadPaneTest"
        Title="MainWindow" Height="350" Width="525">
    <DockPanel>
        <telerik:RadDocking PaneStateChange="RadDocking_PaneStateChange_1" telerik:AnimationManager.IsAnimationEnabled="False" HasDocumentHost="False" Margin="0,50,0,0" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"  Grid.RowSpan="2" telerik:StyleManager.Theme="Windows8" BorderThickness="0">
 
            <telerik:RadSplitContainer telerik:ProportionalStackPanel.RelativeSize="120, 200" MinWidth="450" InitialPosition="DockedLeft" telerik:StyleManager.Theme="Windows8">
                <telerik:RadPaneGroup>
                    <c:CustomPane CanUserPin="False" CanUserClose="False">
                        <ScrollViewer>
                            <TextBlock Text="Very Long Scrollable Text"/>
                        </ScrollViewer>
                    </c:CustomPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </DockPanel>
</Window>

MainWindow.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
 
namespace TelerikRadPaneTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void RadDocking_PaneStateChange_1(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            var radDock = sender as RadDocking;
            if (radDock.IsLayoutChanging)
            {
                var pane = e.OriginalSource as CustomPane;
                if (pane != null)
                {
                    var scrollviewer = pane.Content as ScrollViewer;
                    var view = scrollviewer.Content as TextBlock;
                    Size size = new Size(view.ActualWidth, view.ActualHeight);
                    Point loc = radDock.PointToScreen(new Point(0, 0));
 
                    //start, this won't compile
 
                    var win = pane.GetParentToolWindow();
                    //win.Width = size.Width;
                    //win.Height = size.Height;
 
                    //end
                }
            }
        }
    }
}

CustomPane.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telerik.Windows.Controls;
 
namespace TelerikRadPaneTest
{
    public class CustomPane : RadPane
    {
        public CustomPane()
            : base()
        {
            base.ContextMenuTemplate = null;
        }
 
        protected override void OnMouseEnter(System.Windows.Input.MouseEventArgs e)
        {
            this.ChangeVisualState(true);
        }
 
 
        protected override void OnMouseUp(System.Windows.Input.MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);
 
            if (!this.IsPinned)
            {
                this.IsPinned = true;
            }
        }
 
 
    }
 
}
KA
Top achievements
Rank 1
 answered on 29 Jan 2013
2 answers
154 views
I have added a text box into a menu with the following code. 

<telerik:RadMenuItem x:Name="EmployeeLookupMenuItem" StaysOpenOnClick="True" >
     <telerik:RadMenuItem.Header>
          <StackPanel>
               <telerik:RadWatermarkTextBox Name="EmployeeLookupTextBox" KeyUp="EmployeeLookupTextBox_KeyUp" WatermarkContent="Employee ID" Width="100" />
          </StackPanel>
     </telerik:RadMenuItem.Header>
</telerik:RadMenuItem>

The text box appears however when I click in it to type something it will only stay in focus while the mouse button is down. As soon as I release the mouse button it loses focus and I can no longer type in the box.

Why can I not type in the textbox?
Dev
Top achievements
Rank 1
 answered on 29 Jan 2013
1 answer
274 views
Hey, I'm using Visual Studio 2012 and have a C# based WPF project.  I've imported the telerik controls into my toolbox and it looks like they're all there except for the RadComboBox.  I can access the RadComboBox library in the code, just can't see it in my toolbox to place in forms.  I've tried switching the version number of my project, but it still doesn't show up.  Is there something I need to do to import the RadComboBox to the toolbox?
Georgi
Telerik team
 answered on 29 Jan 2013
2 answers
163 views
Hello, I'm creating a bar chart. My AxisY is a integer count and my AxisX is a string for a build number.

My ItemSource is pointing to an

ObservableCollection<Tuple<string, int>>

If I have 30 build buckets, when viewing my chart the buckets for my AxisX are numbered 1-30, instead of the string buildnumber. How can I get my buildnumber to show up as the tick name instead of this 1-30?

Thanks, Josh

Image Example
<telerik:RadChart x:Name="radChart" ItemsSource="{Binding DataPoints}"
                          Visibility="{Binding ServiceState,
                          Converter={StaticResource EnumToVisibilityConverter},
                          ConverterParameter=ServiceOk}">
            <telerik:RadChart.DefaultView>
                <telerik:ChartDefaultView>
                    <telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartArea>
                            <telerik:ChartArea.AxisX>
                                <telerik:AxisX  IsDateTime="False"
                                                LayoutMode="Auto"
                                                Title="Build"
                                                LabelRotationAngle="55"
                                                Visibility="Visible"/>
                            </telerik:ChartArea.AxisX>
                            <telerik:ChartArea.AxisY>
                                <telerik:AxisY Title="Unique Crashes"
                                               Visibility="Visible" />
                            </telerik:ChartArea.AxisY>
                        </telerik:ChartArea>
                    </telerik:ChartDefaultView.ChartArea>
                </telerik:ChartDefaultView>
            </telerik:RadChart.DefaultView>
Petar Kirov
Telerik team
 answered on 29 Jan 2013
1 answer
338 views
Hi, 


I'm struggling on a sorting problem. I have 2 gridviews that are bound to the same list. Only one of the gridviews is editable. The other one is for reporting purposes only and so readonly. 

Because they represent the same data, the filtering and sorting must be syncronized. For the sorting part, I've added a 'Sorting' event on grid n°1. In the event handler I copy the sorting descriptors into the second grid. This works fine.

private void GridViewSorted(object sender, GridViewSortedEventArgs e)
{
    var datagrid = sender as RadGridView;
    if (datagrid == null || !datagrid.Equals(EmployeeGrid)) return;
 
    FormationGrid.SortDescriptors.Replace(datagrid.SortDescriptors);
}


When I edit a cell of one of the sorted columns in grid n°1, the grid is automatically sorted according to the existing sorting of that column. This is desired off course. 
However, the event 'GridViewSorted' isn't called and thus my second grid doesn't sort, which makes that my grids aren't sorted equally anymore. 

Does anybody have some advice on how to make sure my both grids are synchronized after a cell edit?
I've tried following already, but sorting on the 2nd grid just kicks in, when you enter and leave the same cell again after you've edited it. 

private void EndCellEdit(object sender, GridViewCellEditEndedEventArgs gridViewCellEditEndedEventArgs)
{
    var datagrid = sender as RadGridView;
    if (datagrid == null || !datagrid.Equals(EmployeeGrid)) return;
 
    FormationGrid.SortDescriptors.Replace(datagrid.SortDescriptors);
}





Dimitrina
Telerik team
 answered on 29 Jan 2013
1 answer
264 views
map
Hi,
I'm new to WPF and telerik and tried to download the example demo Bing and openstreetmap providers
when i try to run it i get a lot of errors and this has been happening to me with all the demo examples.

can someone attach a working project for any map. so I can start from there

or what do i have to change to make the code run beside :

<UserControl x:Class="Telerik.Windows.Examples.Map.Shapefile.WorldContinents.Example"
to be :
<UserControl x:Class="my space name"

delete  xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common"

I keep getting error in this line only:

<UserControl.Resources>
        <example:ShapefileViewModel x:Key="DataContext" Region="world_continents" />
    </UserControl.Resources>


ShapefileViewModel ??!!!


thank you
Andrey
Telerik team
 answered on 29 Jan 2013
3 answers
134 views
Hello,
WPF controls version: 2012.2.0912.40

I'm attempting to create one (1) scheduleview for multiple employees.  (We're using the Day and Week View Definitions only). The goal is to be able to view different "Work Schedules" of several employees. So if I check the employee's name, the scheduleview should only display that employee's work schedule (i.e,. 8am to 5pm, or 9am to 6pm, etc). I can do this fine in code behind using the ScrollTimeRuler(just as a sample), but we are using MVVM and I do not see a way to call ScrollTimeRuler from my ViewModel.

Is this possible? and/or do you have any suggestions or samples?

Thanks,
Brian Foster
Yana
Telerik team
 answered on 29 Jan 2013
9 answers
830 views
Hello,

I am trying to change the styling of RadPanes. I ultimately want to also change the shape of the tabs, but for now I am just trying to customize the colors of the tabs, text, and border of the pane.

I tried putting a RadDocking with a RadPaneGroup and two RadPanes in Blend. I can see the tabs, but when I click on the RadDocking item in the Objects and Timeline, I only see an option to edit a copy of the Template, not the Style. Using the Object > Edit Style menu only show the Create Empty option enabled.

I would appreciate any help as I won't have any hair left to pull out soon. Thanks.
Masha
Telerik team
 answered on 29 Jan 2013
0 answers
99 views
There is an window with three combo boxes:
<Window ... >
    <StackPanel>
        <telerik:RadAutoCompleteBox/>
          
        <telerik:RadAutoCompleteBox
            x:Name="_combo"
        />
      
        <telerik:RadAutoCompleteBox/>
    </StackPanel>
</Window>

and back code:
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        Loaded += MainWindow_Loaded;   
    }
 
    void MainWindow_Loaded(object sender, RoutedEventArgs e)
    {
        _combo.Focus();
        //_combo.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); //(!)         
    }
}



Steps:
1. show window
2. type some text (without tabs)

expected: some text appears in second combo box with name "_combo".
actual: second combo box has focused appearance, but does not accept any input
actual with line (!) uncommented: as expected.

This is strange behavior because, for example, dateTimePicker would work as expected without uncommenting line (!)
Alexus
Top achievements
Rank 1
 asked on 29 Jan 2013
2 answers
202 views
Hello.
Question is "How to tell RadTimePicker to parse input text from CurrentDateTimeText property and refresh SelectedTime property by parsed value".

Background:
My control consists from RadTimePicker and two buttons - accept and cancel.
It works but there is an issue.
If user input "1234" to the picker an then press accept button without pressing enter - there is old value in  SelectedTime property (but  CurrentDateTimeText contains user`s input). 

Thanks.
Alexus
Top achievements
Rank 1
 answered on 29 Jan 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
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?