Telerik Forums
UI for WPF Forum
8 answers
175 views
Hi,

I'm trying to add a RadDocking control to my project. However I've noticed when I try to drag a pane from a tabbed position to another position the pane isn't under the mouse. So when I want to snap to the side or whatever I have to guess the point of reference as dragging my mouse over the compass has no effect.

I've attached a screenshot that shows the mouse position whilst dragging. The docking example I'm testing is from the SDK samples. If I stop dragging an reselect the window everything works as expected.

Thanks for any help.
Kalin
Telerik team
 answered on 13 Mar 2015
8 answers
305 views
I've had a look, but can't see anything about other people having this particular issue.

We have a WPF library that contains a RadWindow with a textbox, requiring user input. 
We then have a WinForms application that creates and show this RadWindow.
When we try to type in the textbox, nothing happens.

If we use a regular WPF window for the dialog, then we can use the ElementHost.EnableModelessKeyboardInterop() function, which makes everything work as expected. However, the RadWindow isn't actually a window, so we can't use this method.

So how do we resolve this issue?

Thanks
Jason
Kalin
Telerik team
 answered on 13 Mar 2015
3 answers
471 views
I am using the RadComboBox for an autocomplete selector in my WPF project. My available list of items is well over 200, and has the potential to be well over 1000 at any given time. When I an in edit mode for the combo box, it filters correctly based on the list items but I have run into a problem that I don't know how to fix with it. If the list goes from really large (all the items) to say like 30-40 items, the scroll bar thumb acts a bit weird. If I use the mouse wheel to scroll, it acts as if the entire list is still there, until it gets to a certain point. Once it reaches this point, the thumb of the scroll bar becomes the correct, larger size. But if I scroll up, it once again becomes the small size like it thinks the whole list is there. How can I fix this? I have posted my XMAL for what I have done below.



    <!-- Styles for the telerik RadComboBox -->
    <Style x:Key="RadComboBoxStyle" TargetType="{x:Type telerik:RadComboBox}">
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="Padding" Value="5,0,5,0"/>
        <Setter Property="Foreground" Value="#1A1A1A"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="MinWidth" Value="140" />
        <!--<Setter Property="DropDownWidth" Value="*" />-->
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                            <Border x:Name="OuterBd" CornerRadius="4" Padding="1" BorderBrush="Black" BorderThickness="0">
                                <Border.Effect>
                                    <DropShadowEffect Direction="270" ShadowDepth="0.5" BlurRadius="0.5" Opacity="0.25"/>
                                </Border.Effect>
                                <Border x:Name="InnerBd" Background="{StaticResource BaseInnerBorderBrush}" BorderThickness="0" CornerRadius="3" Padding="1">
                                    <Border Background="{TemplateBinding Background}" BorderThickness="0" CornerRadius="2">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
                                            </Grid.ColumnDefinitions>
                                             
                                        </Grid>
                                    </Border>
                                </Border>
                            </Border>
                            <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="true">
                            <Setter Property="BorderBrush"  Value="{StaticResource FocusedBrush}"  />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{StaticResource BaseButtonMouseOverBrush}"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Black" />
                            <Setter Property="BorderThickness" Value="1" />
                             
                        </Trigger>
                        <Trigger Property="IsDropDownOpen" Value="true">
                            <Setter Property="Background" Value="{StaticResource PressedBrush}"/>
                            <Setter Property="BorderBrush" Value="#BCBCBC"/>
                            <Setter TargetName="OuterBd" Property="Effect" Value="{x:Null}"/>
                            <Setter Property="Foreground" Value="#FFFFFF"/>
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="true"/>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" Value="#E6E7E8"/>
                            <Setter Property="BorderBrush" Value="#A7A9AC"/>
                            <Setter TargetName="OuterBd" Property="Effect" Value="{x:Null}"/>
                            <Setter TargetName="InnerBd" Property="Background" Value="#E6E7E8"/>
                            <Setter Property="Foreground" Value="#6D6E71"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
     
    <!-- Styles for the telerik RadComboBoxItem -->
    <Style TargetType="{x:Type telerik:RadComboBoxItem}">
        <Setter Property="Padding" Value="5,0,5,0"/>
        <Setter Property="Foreground" Value="#1A1A1A"/>
        <Setter Property="Background" Value="#FFF2F2F2"/>
        <Setter Property="MinWidth" Value="140" />
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="BorderThickness" Value="0,0,0,0" />
        <!--<Setter Property="BorderBrush" Value="#6D6E71"/>-->
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadComboBoxItem}">
                    <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                             
                        </ContentPresenter>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter Property="Foreground" Value="White" />
                            <Setter Property="Background" Value="#499ACF" />
                        </Trigger>
                        <Trigger Property="IsHighlighted" Value="False">
                            <Setter Property="Background" Value="#F2F2F2" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#939598"/>
                            <Setter Property="Background" Value="#FFF4F4F4"/>
                        </Trigger>
                        <Trigger Property="IsKeyboardFocusWithin" Value="true">
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
 
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Border Style="{StaticResource DialogContentBorderStyle}" Grid.Row="1">
        <DockPanel Margin="16,10,0,0">
            <Grid Margin="0,10,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="LabelColumn" MinWidth="60" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="70" />
                </Grid.ColumnDefinitions>
 
                <TextBlock Grid.Row="0" Grid.Column="0" Text="Select Item"
                            Style="{StaticResource LabelTextBlock}" CoreExt:TextBoxExtension.IsRequired="True" Visibility="{Binding Request, Converter={StaticResource BoolVisibilityConverter}}"/>
 
                <telerik:RadComboBox Name="RadComboBox" Grid.Row="0" Grid.Column="1" Margin="{StaticResource ModalRowMargin}" ItemsSource="{Binding Available}"SelectedItem="{Binding Selected, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, Mode=TwoWay}" Visibility="{Binding RequestCase, Converter={StaticResource BoolVisibilityConverter}}"TextSearchMode="Contains" Text="{Binding Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" IsFilteringEnabled="True" OpenDropDownOnFocus="True" Style="{StaticResource RadComboBoxStyle}" IsEditable="True" behaviors:RadComboBoxBehaviors.OverrideRadDefaults="True" StaysOpenOnEdit="True" >
                    <telerik:RadComboBox.ItemContainerStyle>
                        <Style TargetType="{x:Type telerik:RadComboBoxItem}" BasedOn="{StaticResource {x:Type telerik:RadComboBoxItem}}">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding CaseId}" Value="-1">
                                    <Setter Property="IsEnabled" Value="False" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type telerik:RadComboBoxItem}">
                                                <Border Background="#F4F4F4">
                                                    <Separator HorizontalAlignment="Stretch" Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" Height="1"/>
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:RadComboBox.ItemContainerStyle>
                    <telerik:RadComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock TextTrimming="WordEllipsis" ToolTip="{Binding}" Text="{Binding}" MaxWidth="250"></TextBlock>
                        </DataTemplate>
                    </telerik:RadComboBox.ItemTemplate>
                     
                </telerik:RadComboBox
            </Grid>
        </DockPanel>
    </Border>
</Grid>
Masha
Telerik team
 answered on 13 Mar 2015
3 answers
230 views
ItemsIndent works well with nodes containing children.  But then on a leaf node it doesn't.  Is there a way to move the leaf node further to the left?  See image attached for depiction.

<UserControl x:Class="MyApp.ToolboxControl"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <DataTemplate x:Key="Level1">
            <Grid Margin="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding ImageUrl}" Stretch="None"/>
                <TextBlock Grid.Column="1" Text="{Binding Name}"/>
            </Grid>
        </DataTemplate>
 
        <HierarchicalDataTemplate x:Key="Level2"
                                  ItemsSource="{Binding Items}"
                                  ItemTemplate="{StaticResource Level1}">
            <Grid Margin="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding ImageUrl}" Stretch="None"/>
                <TextBlock Grid.Column="1" Text="{Binding Name}"/>
            </Grid>
        </HierarchicalDataTemplate>
        <HierarchicalDataTemplate x:Key="Level3"
                                  ItemsSource="{Binding Items}"
                                  ItemTemplate="{StaticResource Level2}">
            <Grid Margin="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding ImageUrl}" Stretch="None"/>
                <TextBlock Grid.Column="1" Text="{Binding Name}"/>
            </Grid>
        </HierarchicalDataTemplate>
    </UserControl.Resources>
    <Grid>
        <telerik:RadTreeView ItemsSource="{Binding Items}"
                             ItemTemplate="{StaticResource Level3}"
                             ItemsIndent="10"/>
    </Grid>
</UserControl>
Milena
Telerik team
 answered on 13 Mar 2015
1 answer
189 views
Hello,

I'm using PieChart with VM-binding and have ArgumentNullException exception in ChartSelectionBehavior.Branch.cs:
internal void UpdateSelectedPointsAndRaiseSelectionChanged()
        {
            var oldSelectedPoints = this.chart.SelectedPoints; // SelectedPoints is always null
            var newSelectedPoints = this.GetSelectedPoints();
 
            ////var oldSelectedSeries = this.chart.SelectedSeries;
            ////var newSelectedSeries = this.GetSelectedSeries();
 
            var addedPoints = newSelectedPoints.Except(oldSelectedPoints).ToList(); //exception here
            var removedPoints = oldSelectedPoints.Except(newSelectedPoints).ToList();

My XAML:
<telerik:RadPieChart SelectedPoints="{Binding SelectedPoints}">
    <telerik:RadPieChart.Resources>
        <Style x:Key="PieSliceStyle" TargetType="Path">
            <Setter Property="Fill" Value="{Binding DataItem.Brush}" />
        </Style>
    </telerik:RadPieChart.Resources>
    <telerik:RadPieChart.SmartLabelsStrategy>
        <telerik:PieChartSmartLabelsStrategy DisplayMode="SpiderAlignedOutwards"/>
    </telerik:RadPieChart.SmartLabelsStrategy>
    <telerik:RadPieChart.Behaviors>
        <telerik:ChartSelectionBehavior DataPointSelectionMode="Multiple"
                                        x:Name="PieSelectionBehavior"/>
    </telerik:RadPieChart.Behaviors>
    <telerik:RadPieChart.Series>
        <telerik:DoughnutSeries ItemsSource="{Binding PieChartErrors}"
                                ValueBinding="Count"
                                DefaultSliceStyle="{StaticResource PieSliceStyle}">
            <telerik:DoughnutSeries.LegendSettings>
                <telerik:DataPointLegendSettings TitleBinding="Description"/>
            </telerik:DoughnutSeries.LegendSettings>
            <telerik:DoughnutSeries.LabelConnectorsSettings>
                <telerik:ChartSeriesLabelConnectorsSettings/>
            </telerik:DoughnutSeries.LabelConnectorsSettings>
        </telerik:DoughnutSeries>
    </telerik:RadPieChart.Series>
</telerik:RadPieChart>

ViewModel:
public class ErrorsAndWarningsViewModel : Page
{
    private IObservableCollection<PieChartError> _pieChartErrors;
    private ReadOnlyDataPointCollection _selectedPoints;
 
    public ErrorsAndWarningsViewModel
    {
        PieChartErrors = new BindableCollection<PieChartError>();
        SelectedPoints = new ReadOnlyDataPointCollection();
    }
 
    public IObservableCollection<PieChartError> PieChartErrors
    {
        get { return _pieChartErrors; }
        set
        {
            if (Equals(value, _pieChartErrors))
            {
                return;
            }
            _pieChartErrors = value;
            NotifyOfPropertyChange();
        }
    }
 
    public ReadOnlyDataPointCollection SelectedPoints
    {
        get { return _selectedPoints; }
        set
        {
            _selectedPoints = value;
            NotifyOfPropertyChange();
        }
    }
 
    public class PieChartError
    {
        public string Description { get; set; }
        public int Count { get; set; }
        public Brush Brush { get; set; }
    }
}

What am I doing wrong?
Martin Ivanov
Telerik team
 answered on 12 Mar 2015
1 answer
191 views
Hi,
When I try to copy a lot of data from my grid to the excel sheet, some rows are missing.

I found this solution on your forum

private void gridview_Copying(object sender, RadRoutedEventArgs e)
{
var obj = Clipboard.GetDataObject();
           var data = obj.GetData(DataFormats.Text);
           Clipboard.SetData(DataFormats.Text, data);
...
}

All data now are copied to excel but if into a cell there is a newline char, excel will create a new row
How can I fix it?

Another question..
I read that when I copy from grid on the clipboard all data are saved as html, csv and txt
My grid has around 500 000 cells, and the coping operation is not performed at all.
I think the problem is the html, and I need only the data without any kind of formatting.
So is it possible to saved only the txt on the clipboard?

Thanks

Maya
Telerik team
 answered on 12 Mar 2015
1 answer
99 views
Dear Reader,

First i'm sorry for my bad english.

I would like know, how update the ChartAxisLabelFormat in RadChart ?

I have it : http://www.casimages.com/i/15031104592612847.png (default value)

And what i want (I want binding with MySQL Data Table) : http://www.casimages.com/i/150311050226369990.png

Thanks you.

Cordialy yours,

DEFRANCE
Peshito
Telerik team
 answered on 12 Mar 2015
3 answers
152 views
I found that you said we have problem with Tabindex of RadAutoCompleteBox in Link
Was this problem fixed?
Kalin
Telerik team
 answered on 12 Mar 2015
1 answer
85 views
Hello, I tried implicit style with RadWindow as the main WIndow.
No problem, except with the VS2013 theme : when the radwindow is maximised, I've git 2 or 3 pixels at the bottom and the right side of the window. I don't have those pixels with other themes, and the RadWindow is perfectly maximised...
Thanks.
Masha
Telerik team
 answered on 12 Mar 2015
8 answers
113 views
Hi,

I'm facing a problem with ordering and filtering for Gridview control. For some reason '100' is considered smaller than 60 or 90. I think you can understand the problem better from the attached screenshot. 
Ejaz
Top achievements
Rank 1
 answered on 12 Mar 2015
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?