Telerik Forums
UI for WPF Forum
1 answer
201 views
hello all, I use the follwing code to create a radsplitcontainer dynamically and it works perfectly fine.

However when I try to add a pane group (commeneted code) I couldn't even see the split container showing to the right side of the window

Any suggestions, please?

Telerik.Windows.Controls.RadSplitContainer RightSplit =

 

new Telerik.Windows.Controls.RadSplitContainer();

RightSplit.InitialPosition = Telerik.Windows.Controls.Docking.DockState.DockedRight;

RightSplit.BorderBrush = Brushes.DarkSlateGray;

RightSplit.BorderThickness =

 

new System.Windows.Thickness(3);

RightSplit.Width =

 

100;

RightSplit.IsEnabled =

 

true;

RightSplit.Visibility = Visibility.Visible;

MainContainer.Items.Add(RightSplit);

 

//Telerik.Windows.Controls.RadPaneGroup thispaneGroup = new Telerik.Windows.Controls.RadPaneGroup();

 

//thispaneGroup.Width = 100;

 

//RightSplit.Items.Add(thispaneGroup);


Regards
RK
Georgi
Telerik team
 answered on 28 Sep 2012
1 answer
143 views
I have been looking around for how to do a pie chart with a hollow middle (see the attachment), but have come up empty so far after searching for information on RadPieChart and PieSeries in particular, and for creating my own Path or Style in general. What would be the strategy to do this kind of pie chart?

I am building the PieSeries in C# code and not in XAML, so C# would be greatly appreciated. Thanks.
Vladimir Milev
Telerik team
 answered on 28 Sep 2012
0 answers
266 views
Hi there,

I am currently having troubles with RoutedEvent in WPF. I made a simple example only using native WPF components. The example is made of a button executing a long term synchronous task the first time it's hit and showing a message "Already executed" all other times.

What you have to do to reproduce my issue is to click the button once, and when the task is executing click a second time => After finishing the first task the second click event is going to trigger a second execution => "Already executed". I want to consume any user input during the execution before it triggers an event.

How could I do that ?

<Window x:Class="TestDBConnection.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
         
        <Button Name="butt" Height="30" Width="150" />
        <Label Visibility="Collapsed" Name="label">Executing ... </Label>
    </Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 System.Data.Objects;
 
namespace TestDBConnection
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
 
            var cmd = new MyCommand();
            //butt.Command = cmd;
 
            //butt.PreviewMouseDown += new MouseButtonEventHandler(butt_PreviewMouseDown);
            butt.Click += butt_Click;
 
            cmd.label = label;
            cmd.bouton = butt;
 
        }
 
        void butt_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            //label.Visibility = Visibility.Visible;
        }
 
        void butt_Click(object sender, RoutedEventArgs e)
        {
            if (executedAlready)
            {
                MessageBox.Show("Already Executed");
                return;
            }
 
            for (long i = 0; i < 40000; i++)
            {
                for (long j = 0; j < 40000; j++)
                {
                    var a = i + j;
                }
            }
 
            //label.Visibility = Visibility.Collapsed;
            executedAlready = true;
        }
 
        private bool executedAlready;
    }
 
    public class MyCommand : ICommand
    {
 
        public bool CanExecute(object parameter)
        {
            return true;
        }
 
        public event EventHandler CanExecuteChanged;
 
        public void Execute(object parameter)
        {
            if (executedAlready)
            {
                MessageBox.Show("Already Executed");
                return;
            }
 
            for (long i = 0; i < 40000; i++)
            {
                for (long j = 0; j < 40000; j++)
                {
                    var a = i + j;
                }
            }
 
            executedAlready = true;
 
            label.Visibility = Visibility.Collapsed;
        }
 
        public Label label;
        public Button bouton;
        public Window window;
 
        private bool executedAlready;
    }
}
Joël
Top achievements
Rank 2
 asked on 28 Sep 2012
1 answer
599 views
I have been searching for a while now and have not come up with solution to a feature I need to implement.

I have set the background color for multiple columns in my RadGridView to be bound to a user's selection. For example, if they select option 1, the first column will be highlighted. If they select option 2, the second column is highlighted, and the highlight from the first column is removed. I currently have the style for the column set up as follows:

<telerik:GridViewColumn.Style>
    <Style BasedOn="{StaticResource CommonColumnStyle}" TargetType="{x:Type telerik:GridViewColumn}">
        <Style.Triggers>
            <DataTrigger Value="True">
                <DataTrigger.Binding>
                    <MultiBinding Converter="{StaticResource ColumnIsSelectedConverter}" ConverterParameter="0">
                        <Binding ElementName="LayoutRoot" Path="DataContext.AllowedOptions" />
                        <Binding ElementName="LayoutRoot" Path="DataContext.SelectedOptions" />
                    </MultiBinding>
                </DataTrigger.Binding>
                <Setter Property="Background" Value="{DynamicResource ColumnHighlightColor}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
</telerik:GridViewColumn.Style>

The CommonColumnStyle just defines text alignment, trimming, and a default background of transparent. The ColumnIsSelectedConverter returns true or false. The ViewModel contains an IList of options that are displayed to the user in the order that they also appear in the grid. This lets me use the ConverterParameter to specify that this is the nth column in the XAML.

There are two problems with this implementation:

  1. I'm also defining footers for these columns. The first column's data cells and footer start with the ColumnHighlightColor. If the user changes the selected option, the data cell backgrounds update, but the footer background does not change. (e.g. first column returns to transparent, second column is now highlighted, but the first column's footer is still highlighted and the second footer is transparent.) I was able to get around this by defining a style/triggers for the footer cells as well, but I don't think that should be necessary. I'm curious if this is by design or a bug.

  2. The column background only appears for rows with data and in the footer row, not the unoccupied rows. We have our GridView set to fill up most of the screen, so we would like the column background to show up from the top of the GridView to the bottom. Is there a way around this?

Thanks!
Maya
Telerik team
 answered on 28 Sep 2012
1 answer
210 views
Is there any way that I can do that?
Petar Kirov
Telerik team
 answered on 27 Sep 2012
1 answer
182 views
We have a RadGridView with a Hierarchical RadGridView in a template.
We bind the selected item of the Hierarchical grid to an object in our ViewModel. (with PropertyChanged...).

When we change the object in our ViewModel, the expected row in de Hierarchical grid is not selected.

Is there a way to select an item in a Hierarchical grid from codebehind?.

Dimitrina
Telerik team
 answered on 27 Sep 2012
1 answer
178 views
I'm working on a project about Persian spell checker in the C# language. I have googled it and found some alternatives, but non of them draw "Wavy line" under misspelled words. for example I try to use Telerik RadRichTextBox and set my Application's Culture to "fa-IR" then load Persian Dictionary but It draw "Wavy Line" under any word (even correct English words) Except Persian Word. So I want to know, How can I draw wavy line under a certain word?
Vasil
Telerik team
 answered on 27 Sep 2012
3 answers
155 views
Hi,

We are getting errors related to DataQueryService class when we construct a QueryableDataServiceCollectionView instance from a WCFDataServices 5.0 DataServicesContext and DataServiceQuery.The application is complaining about the WCF DataService 4.0 assembly (System.Data.Services.Client.dll) !!!

The errors occurred after we ported the application from (WPF4.0 + WCFDataServices 4.0 + EF4.3) to (WPF4.5 + WCFDataServices 5.0 + EF5.0).

I saw an earlier reply from Telerik team that QueryableDataServiceCollectionView is not supported with WCF Data Services October 2011 CTP.Does this also apply to WCF DataServices 5.0 which is an offical version ??.



Environment:

VS 2012 Ultimate
NET 4.5
EF 5.0
WCF Data Services 5.0
WPF 4.5
Telerik WPF 2012.2 912

Thanks in advance

Madani


Rossen Hristov
Telerik team
 answered on 27 Sep 2012
1 answer
155 views
Hi, currently i am constructing a DataTemplate for OutlookbarItem as following using a ListView displaying a list of my ViewModel (LHSBrowseItem which contains a list of items i like to display inside a listview)

<DataTemplate x:Key="dtOutlookBarItem" DataType="LocalViewModel:LHSBrowseItem">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <TextBox Name="tboxTelerik"  Visibility="{Binding Path=AllowSearch, Converter={StaticResource converterBoolVisibility}}">
                </TextBox>
                <LocalControls:ucSpinnerSwirl x:Name="lhsProgressBar" Grid.Row="1" HorizontalAlignment="Center" Margin="5" Visibility="{Binding Path=CollectionLoaded, Converter={StaticResource  converterBoolVisibilityRvs}}"/>
                <ListView Name="lstViewTelerik" Grid.Row="1" 
                          ItemsSource="{Binding Path=Items}"
                          IsSynchronizedWithCurrentItem="True"
                          Visibility="{Binding Path=CollectionLoaded, Converter={StaticResource  converterBoolVisibility}}"
                          SelectionChanged="ListView_SelectionChanged">
                <ListView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel></VirtualizingStackPanel>
                    </ItemsPanelTemplate>
                </ListView.ItemsPanel>
                    <ListView.ItemTemplate>
                        <DataTemplate DataType="LocalViewModel:LHSItem">
                            <TextBlock Text="{Binding Path=Label}"/>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
           </Grid>
        </DataTemplate>


However, i encounter problems when the listview items size is around 5000:

(1) When i minimize and then maximize the outlookbar, the maximizing takes around 2-3 seconds before the windows shows and become reponsive

(2) Same thing happens when i try to resize the main window, it will "hangs " for 2-3 secs before i can operate the outlook bar

To me, it seems that the inside the outlookbar is redrawing itself whenever there is a change. 

[Additional Information]

My style for this outlook bar is as following, 
<DataTemplate x:Key="dtOutlookBarDropdown" >
    <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Image Grid.Column="0"
                   Width="20"
                   HorizontalAlignment="left"
                   Source="{Binding SmallIcon}" />
            <Label Grid.Column="1"
                   HorizontalAlignment="Center"
                   Content="{Binding Header}" />
    </Grid>
</DataTemplate>
 
<Style TargetType="{x:Type TelerikNavigation:RadOutlookBar}">
    <Setter Property="Width" Value="220"/>
    <Setter Property="IsVerticalResizerVisible" Value="False"/> 
    <Setter Property="ItemDropDownContentTemplate" Value="{StaticResource dtOutlookBarDropdown}"/>             
</Style
<Style TargetType="{x:Type TelerikNavigation:RadOutlookBarItem}">
    <Setter Property="Title" Value="{Binding Header}"/>
    <Setter Property="Header" Value="{Binding Header}"/>
    <Setter Property="FontWeight" Value="Bold"/>
    <Setter Property="Icon" Value="{Binding LargeIcon}"/>
    <Setter Property="SmallIcon" Value="{Binding SmallIcon}"/>
    <Setter Property="ToolTip" Value="{Binding Header}"/>
    <Setter Property="ContentTemplate" Value="{StaticResource dtOutlookBarItem}"/>           
</Style>

One strange thing i notice is that when outlookbar item with 5k listview items is shown, somehow it also affects another tab control performance, it makes the tab switching quite slow, it pause around 1 sec before the tab switches to other tab and when the outlookbar is minimized, the problem is gone.

your help will be appreciated. Btw, we have purchased your official license. :) 

Can u help regarding this?

thanks a lot

   
Hristo
Telerik team
 answered on 27 Sep 2012
3 answers
164 views
Hi,
i need to change at run time the culture of all controls used in my application, but i've a RadTimeBar's localization problem.

I've try to use the solution posted by Evgenia in the "TimeBar Localization does not work - please help" thread with a button that set the French culture on click, but it doesn't work for me.

My code behind is:

        private void btn_Click(object sender, RoutedEventArgs e)
        {
            CultureInfo culture = new CultureInfo("fr");
            System.Threading.Thread.CurrentThread.CurrentCulture = culture;
            System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
        }

The only way to change the language of RadTimeBar's labels is to destroy and recreate the RadTimeBar on windows loaded, because nothing changes if i only set the Culture.

I'm using Q3-2011 version, there's any other solution for this problem?

Thanks,

Rob
Tsvetie
Telerik team
 answered on 27 Sep 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
PersistenceFramework
DataPager
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?