Telerik Forums
UI for WPF Forum
1 answer
70 views
How do I tell a floating pane which monitor to use?
It seems that if it get a Point from my form and use an offset that the floating pane uses the whole screen area available and not the monitor that the form is on.  I can subtract from the point to get the floating pane to be on the correct monitor, however if I use a machine with anohter monitor orientation it does not show up where expected.

Is there a way to determine which monitor a floating pane should display?
Rick Knicely
Top achievements
Rank 1
 answered on 23 Jul 2010
1 answer
415 views
Hi,

I've some problem with my treeview, idk if my problem is directly from the treeview or not.
What i'ld like to do is somethink like this :
- Website 1
- Month A
- picture 1
- picture 2
- Month B
- picture 1
- Website 2
- Month A
- picture 1

The problem i've meet is that for all node "website", i've the same child nodes.
Thx :)

Here is my code :
MainWindow.xaml
<Window xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"  x:Class="BonjourWPF.MainWindow"
        xmlns:local="clr-namespace:BonjourWPF"
        xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        Title="MainWindow" Height="768" Width="1024">
    <Window.Resources>
        <local:WebSites x:Key="WebsiteCollection" />
 
        <CollectionViewSource
            x:Key="Sites"
            Source="{Binding Source={StaticResource WebsiteCollection}}">
        </CollectionViewSource>
        <CollectionViewSource
                            x:Key="GroupMonth"
                            Source="{Binding Source={StaticResource Sites},Path=Pictures}">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="date"></scm:SortDescription>
            </CollectionViewSource.SortDescriptions>
            <CollectionViewSource.GroupDescriptions>
                <PropertyGroupDescription PropertyName="month" />
            </CollectionViewSource.GroupDescriptions>
        </CollectionViewSource>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="256" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="256" />
            </Grid.RowDefinitions>
            <Grid.Resources>
                <DataTemplate x:Key="Picture" DataType="Picture">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding date, StringFormat={}{0:dd/MM/yyyy}}"  Foreground="Black" />
                    </StackPanel>
                </DataTemplate>
 
                <HierarchicalDataTemplate x:Key="Mois" ItemsSource="{Binding Path=Items}" ItemTemplate="{StaticResource Picture}">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Name}" Foreground="Black" />
                    </StackPanel>
                </HierarchicalDataTemplate>
 
                <HierarchicalDataTemplate x:Key="Site" ItemsSource="{Binding Source={StaticResource GroupMonth},Path=Groups}"  ItemTemplate="{StaticResource Mois}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding icon}" Margin="0,0,6,0"/>
                        <TextBlock Text="{Binding name}"  Foreground="Black" FontWeight="Bold"
                            FontSize="15" />
                    </StackPanel>
                </HierarchicalDataTemplate>
 
            </Grid.Resources>
 
            <my:RadTreeView Name="RadTreeView1" ItemsSource="{Binding Source={StaticResource Sites}}" ItemTemplate="{StaticResource Site}" IsSingleExpandPath="True">
            </my:RadTreeView>
             
        </Grid>
        <Image Grid.Column="1" Name="image1" Stretch="Uniform" />
    </Grid>
</Window>


public class WebSites : ObservableCollection<WebSite>
{
    public WebSites()
    {
        this.Add(new WebSite()
        {
            id = 1,
            name = "Site 1",
            icon = "site1.ico"
        });
 
        this.Add(new WebSite()
        {
            id = 2,
            name = "Site 2",
            icon = "site2.ico"
        });
    }
}

public class Picture
{
    public DateTime date { get; set; }
    public String year
    {
        get
        {
            return date.Year.ToString();
        }
    }
    public String month
    {
        get
        {
            return DateTimeFormatInfo.CurrentInfo.GetMonthName(date.Month);
        }
 
    }
    public String path { get; set; }
}

    public class WebSite
    {
        public Int32 id { get; set; }
        public String name { get; set; }
        public String icon { get; set; }
 
        public WebSite()
        {
        }
 
 
        private ObservableCollection<Picture> _pictures;
        public ObservableCollection<Picture> Pictures
        {
            get {
                if (_pictures == null)
                {
                    _pictures = new ObservableCollection<Picture>();
                    if (Directory.Exists(name))
                    {
                        foreach (String file in Directory.GetFiles(name))
                        {
                            _pictures.Add(new Picture() { date = Convert.ToDateTime(Path.GetFileNameWithoutExtension(file)), path = Path.GetFullPath(file) });
                        }
                    }
                }
                return _pictures;
            }
            set
            {
                _pictures = value;
            }
        }
}
Hristo
Telerik team
 answered on 23 Jul 2010
4 answers
403 views
I have to format numbers to a user defined precision; I created a binding to a property where precision is stored:

            Binding precisionBinding;
            precisionBinding = new Binding("Item.Format[" + column.UniqueName + "].Precision");
            precisionBinding.Mode = BindingMode.OneWay;
            precisionBinding.Converter = new PrecisionConverter();

and set CellStyle:

            cellStyle.Setters.Add(new Setter(GridViewCell.ContentStringFormatProperty, precisionBinding));

but format returned by PrecisionConverter() is ignored at all.
Thanks
Yavor Georgiev
Telerik team
 answered on 23 Jul 2010
5 answers
271 views
Hello everyone,

I am using WPF App with carousel on an IPC with Windows 7 Embedded and 1GB RAM and Intel Atom 1,6 GHz. I have the Q1 Version of telerik controls. Carousel has shadow, scalling and opacity on.

My problem is that the performance is to bad, the scrolling of the carousel isn't fluid.

My question is what are the minimum requirements concering RAM, CPU for carousel control ?
How far performance depends on graphic chip ? 
Have somebody faced the same problems ?
How can I increase performance generally ?

It will be very pity to remove carousel from my application.

Thank you.

Daniel
Milan
Telerik team
 answered on 23 Jul 2010
2 answers
132 views
Hello everyone!

I am currently trying to display a map in a window using WPF. Unfortunately, I do not succeed in changing the size of the map.
In my WPF view I have two buttons and my RadMap control, and if I manually change the width and height of the RadMap object the buttons disappear but also the zoom control which is supposed to be on the map.

Here is my code:

<Window x:Class="WpfRadMapApplication.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    MinHeight="300" MinWidth="300"
    Height="600" Width="600">
    <Grid HorizontalAlignment="Center" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="10*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Button Grid.Row="0" Grid.Column="0" Name="map24Button" Content="Map24" Margin="5" HorizontalAlignment="Center" Click="map24Button_Click" />
        <Button Grid.Row="1" Grid.Column="0" Name="openStreetMapButton" Content="OpenStreetMap" Margin="5" HorizontalAlignment="Center" Click="openStreetMapButton_Click" />
        <telerik:RadMap Grid.Row="2"
                    Grid.Column="0"
                    Name="radMap"
                    ZoomLevel="0"
                    Center="0,0"
                    Background="White"
                    HorizontalAlignment="Center">
        </telerik:RadMap>
    </Grid>
</Window>

Thanks for your help :)!
Mapi
Top achievements
Rank 1
 answered on 23 Jul 2010
1 answer
74 views
on the RadMaskedTextBox, there's a property called IsSpinEnabled that you can turn on or off. This property doesn't seem to be exposed on the GridViewMaskedTextBoxColumn.. Is there another way to turn spin on or off?
Maya
Telerik team
 answered on 23 Jul 2010
1 answer
138 views
Is there a way to use the datafilter control without a datasource?

I need this kind of control to create filter expressions and save them for later use. I need to provide my own columns without the control getting them from a datasource and save the completed filter expression in a database table for later retrieval.

Thanks for your help.
Rossen Hristov
Telerik team
 answered on 23 Jul 2010
2 answers
62 views
I purchased the Ultimate Suite yesterday and my first day using it I cannot add several 2010 Q2 Rad Controls to my WPF form. Trying to add several of the Telerik controls generate the same error.

'/Telerik.Windows.Controls;Component/themes/windows7/BusyIndicator.xaml" value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Type reference cannot find public type named 'RadBusyIndicator'. Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.Windows.Controls;component/Themes/GenericWindows7.xaml.'

I get this error trying to add a RadChart, RadButton, RadDropDownButton, RadRadioButton, RadSplitButton, RadToggleButton, and the list goes on and on. For $2000 I was expecting things to work out of the box. Do I need to go to an older version of your product? Please help.

Dan
Valentin.Stoychev
Telerik team
 answered on 23 Jul 2010
3 answers
188 views
Hi ,
I am new to Wpf, EntityFramework and Telerik,
but i am trying to do the following :
I have a generic gridwindow ( telerik grid ) , that doesnt know what data it will display at compile time.
The grid is set to autogenerate the columns once it get a collection of data.

The data is a observable collection of EF Entities.
In the AutoGeneratingColumn event, I intercept each column.
columns of type Collection are skipped over,
columns of type String, Datetime or primitive types are shown.

I would like to replace the single columns to other Entities by n columns for their own primitive values.
So if i have a Entity Customer with a Property Address.
My grid would show by default :
Customer fields with binding path : Name, FirstName etc.
Address fields with binding path : Address.City, Address.Zip etc. all on the same row.

the code :
the Event :
 Telerik.Windows.Controls.GridViewBoundColumnBase c = gvc as Telerik.Windows.Controls.GridViewBoundColumnBase;
     if ((!c.DataType.FullName.StartsWith("Afda.Model.TrackableCollection"))
              &&  (!c.DataType.FullName.StartsWith("Afda.Model.Obj")))
                {
                    foreach (System.Reflection.PropertyInfo pi2 in c.DataType.GetProperties())
                    {
                        if (pi2.PropertyType.BaseType.IsValueType || pi2.PropertyType.FullName.Equals("System.String") || pi2.PropertyType.FullName.Equals("System.DateTime")
                            || pi2.PropertyType.BaseType.FullName.Equals("System.ValueType"))
                        {
                            Telerik.Windows.Controls.GridViewDataColumn newColumn = new Telerik.Windows.Controls.GridViewDataColumn();
                            newColumn.Width = c.ActualWidth;
                            newColumn.DisplayIndex = c.DisplayIndex;
                            String s = c.DataMemberBinding.Path.Path + "." + pi2.Name;
                            newColumn.DataMemberBinding = new Binding(s);
                            newColumn.DataType = pi2.PropertyType;
                            newColumn.DataFormatString = c.DataFormatString;
                            newColumn.TextAlignment = c.TextAlignment;
                            newColumn.Header = s;
                            newColumn.Name = s;
                            newColumn.UniqueName = s;
                            newColumn.Footer = c.Footer;
                            newColumn.IsVisible = true;
                            colsToAdd.Add(newColumn);
                        }
                    }
                    gvc.IsVisible = false;

In the load data method :
 
  try
            {
                DataGrid.ItemsSource = data;
             }
            catch { }

            foreach (Telerik.Windows.Controls.GridViewDataColumn c in colsToAdd) {
                if (!DataGrid.Columns.Contains(c)) {
                    DataGrid.Columns.Add(c);
                }
            }


PS : i also tried doing the add of the new column in the event itsself, but it seemed Icky , and gave a cryptic error.

Any comments ?? it seems to be working most of the time .  ( the embedded Entity isnt always loaded, even if the linq statment is always the same )

No real problems with it atm, so forum prob not the place to post this, but it wasnt working yet, when i started writing :)



Milan
Telerik team
 answered on 22 Jul 2010
2 answers
592 views
I'd like to know a bit more about the DeferRefresh method on the RadGridView. What does it do exactly and how is it used? The documentation states: "Enters a defer cycle that you can use to merge changes to the view and delay automatic refresh" So does it effectively freeze updates from the data source? Do you stop the defer cycle by disposing the object that is returned from DeferRefresh?

Thanks!
Geoff Smith
Top achievements
Rank 1
 answered on 22 Jul 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
Slider
Expander
TileList
PersistenceFramework
DataPager
TimeBar
Styling
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
FilePathPicker
Licensing
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?