Telerik Forums
UI for WPF Forum
9 answers
212 views
Why is there no separation between the second vertical axis and the label for the first vertical axis (see attached image)?

Could you please provide a code example of the easiest way to get some separation.
Peshito
Telerik team
 answered on 30 Apr 2012
0 answers
92 views
Hi,

I am using a telerik grid view.  I have a combo box which is bound to different grids.  e.g.  when I select a combo box then grid display's A property information and if I change settings then it will display grid B's propery information.  I want that when "A" is displayed and I change the format of the grid like reorder columns.  I switch to grid "B" and then switch back to "A" I want to see the reordered columns.  So I need to save settings when I change grid and reload the settings when I load the grid.  But I am not sure how to do this.  If you can point me to some examples that would be great.

Also when I exit the tool and then reopen the file then the settings should be persistant from before so the user doesn't have to change settings again.  I looked at the example here.  http://demos.telerik.com/silverlight/#PersistenceFramework/GridViewCustomSerialization  This is almost what I want to do but can I save the settings in an XML file?  If you have any examples for this that would be great.

Thanks for your help,

Sonia
Sonia
Top achievements
Rank 1
 asked on 30 Apr 2012
5 answers
535 views
Hi

I have been using the property grid and I like it a lot, but now i have problem. Is there a way to add "properties" at runtime?

I have been trying to get a datatable/datarow to work with the property grid with no luck.

Any ideas?

Axel
Mauricio
Top achievements
Rank 1
 answered on 29 Apr 2012
1 answer
225 views
I am plotting about 500 items on the map and everything works fine until I zoom in or out. When this happens the CPU goes to 100% for 10 or so seconds and then things work again until the next zoom.

I used ANTS and found that all the slowness is from the method Telerik.Windows.Controls.Map.FileCacheBase.SaveFilesThread().

I also noticed this xaml error which is not from me:

System.Windows.Data Error: 25 : Both 'ContentTemplate' and 'ContentTemplateSelector' are set; 'ContentTemplateSelector' will be ignored. ContentPresenter:'ContentPresenter' (Name='')


Datafyer
Top achievements
Rank 1
Veteran
 answered on 28 Apr 2012
4 answers
165 views

Why PropertyGrid generate excess properties, when AutoGeneratePropertyDefinitions is set to false?

<Window x:Class="PropertyGridTester.MainWindow"
        xmlns:PropertyGridTester="clr-namespace:PropertyGridTester"
        Title="MainWindow" Height="350" Width="525"
        mc:Ignorable="d" 
        d:DataContext="{d:DesignInstance {x:Type PropertyGridTester:MainWindowViewModel}}">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
          
        <StackPanel Grid.Column="0">
            <RadioButton Command="{Binding SetFirstClass}">Set first class</RadioButton>
            <RadioButton Command="{Binding SetSecondClass}">Set second class</RadioButton>
            <RadioButton Command="{Binding SetNull}" IsChecked="True">Set null</RadioButton>
        </StackPanel>
  
        <ContentControl Grid.Column="1" DataContext="{Binding SelectedClass}" Content="{Binding}">
            <ContentControl.Resources>
                <DataTemplate DataType="{x:Type PropertyGridTester:FirstClass}">
                    <telerik:RadPropertyGrid Item="{Binding}" AutoGeneratePropertyDefinitions="False" HorizontalAlignment="Stretch" SearchBoxVisibility="Collapsed"
                        SortAndGroupButtonsVisibility="Collapsed" DescriptionPanelVisibility="Collapsed" HorizontalContentAlignment="Stretch" LabelColumnWidth="110">
                        <telerik:RadPropertyGrid.PropertyDefinitions>
                            <telerik:PropertyDefinition Binding="{Binding Visible}" DisplayName="First class visible">
                                <telerik:PropertyDefinition.EditorTemplate>
                                    <DataTemplate>
                                        <TextBox Text="{Binding Visible}" />
                                    </DataTemplate>
                                </telerik:PropertyDefinition.EditorTemplate>
                            </telerik:PropertyDefinition>
                        </telerik:RadPropertyGrid.PropertyDefinitions>
                    </telerik:RadPropertyGrid>
                </DataTemplate>
                <DataTemplate DataType="{x:Type PropertyGridTester:SecondClass}">
                    <telerik:RadPropertyGrid Item="{Binding}" AutoGeneratePropertyDefinitions="False" HorizontalAlignment="Stretch" SearchBoxVisibility="Collapsed"
                        SortAndGroupButtonsVisibility="Collapsed" DescriptionPanelVisibility="Collapsed" HorizontalContentAlignment="Stretch" LabelColumnWidth="110">
                        <telerik:RadPropertyGrid.PropertyDefinitions>
                            <telerik:PropertyDefinition Binding="{Binding Visible}" DisplayName="Second class visible">
                                <telerik:PropertyDefinition.EditorTemplate>
                                    <DataTemplate>
                                        <TextBox Text="{Binding Visible}" />
                                    </DataTemplate>
                                </telerik:PropertyDefinition.EditorTemplate>
                            </telerik:PropertyDefinition>
                        </telerik:RadPropertyGrid.PropertyDefinitions>
                    </telerik:RadPropertyGrid>
                </DataTemplate>
            </ContentControl.Resources>
        </ContentControl>
  
    </Grid>
</Window>

using System;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.ViewModel;
  
namespace PropertyGridTester
{
    public abstract class BaseClass : NotificationObject
    {
        private string _Visible = String.Empty;
  
        public string Visible
        {
            get { return _Visible; }
            set
            {
                if (_Visible == value)
                    return;
                _Visible = value;
                RaisePropertyChanged(() => Visible);
            }
        }
  
        private string _NotVisible = String.Empty;
  
        public string NotVisible
        {
            get { return _NotVisible; }
            set
            {
                if (_NotVisible == value)
                    return;
                _NotVisible = value;
                RaisePropertyChanged(() => NotVisible);
            }
        }
  
    }
  
    public class FirstClass : BaseClass
    {
    }
  
    public class SecondClass : BaseClass
    {
    }
  
    public class MainWindowViewModel : NotificationObject
    {
        public MainWindowViewModel()
        {
            SetFirstClass = new DelegateCommand(() => SelectedClass = new FirstClass());
            SetSecondClass = new DelegateCommand(() => SelectedClass = new SecondClass());
            SetNull = new DelegateCommand(() => SelectedClass = null);
        }
  
        public ICommand SetFirstClass { get; private set; }
  
        public ICommand SetSecondClass { get; private set; }
  
        public ICommand SetNull { get; private set; }
  
        private BaseClass _SelectedClass = null;
  
        public BaseClass SelectedClass
        {
            get { return _SelectedClass; }
            set
            {
                if (_SelectedClass == value)
                    return;
                _SelectedClass = value;
                RaisePropertyChanged(() => SelectedClass);
            }
        }
    }
}

Maxim
Top achievements
Rank 1
 answered on 28 Apr 2012
1 answer
145 views
Hi,

Using version 2012.1.326.40 of the DataVisualization control, the ToolTip is not displayed when the RadTimeline is inside a Popup. Mouse hovering over individual items works. Any ideas?

The code below illustrates my symptoms.

<Window x:Class="WpfApplication3.MainWindow"
        xmlns:example="clr-namespace:WpfApplication3"
        Title="MainWindow" Height="350" Width="525">
    <Window.DataContext>
        <example:ExampleViewModel />
    </Window.DataContext>
    <Grid>
         
        <Popup IsOpen="True" Width="800" Height="300">
        <telerik:RadTimeline Grid.Row="0"
                                 PeriodStart="{Binding StartDate, Mode=TwoWay}"
                                 PeriodEnd="{Binding EndDate, Mode=TwoWay}"
                                 VisiblePeriodStart="{Binding VisibleStartDate, Mode=TwoWay}"
                                 VisiblePeriodEnd="{Binding VisibleEndDate, Mode=TwoWay}"
                                 StartPath="StartDate"
                                 DurationPath="Duration"
                                 ToolTipPath="Details"
                                 ItemsSource="{Binding Data}">
            <telerik:RadTimeline.Intervals>
                <telerik:DayInterval />
                <telerik:YearInterval IntervalSpans="1,5" />
                <telerik:MonthInterval IntervalSpans="1,6" />
            </telerik:RadTimeline.Intervals>
        </telerik:RadTimeline>
 
        </Popup>
    </Grid>
</Window>
 
Marc-Andre
Top achievements
Rank 1
 answered on 27 Apr 2012
2 answers
121 views
Are there any basic projects that show how to generate the docking panes in code behind? All current demo samples are XAML file based. Thanks in advance for any info.
Matt
Top achievements
Rank 2
 answered on 27 Apr 2012
1 answer
267 views
I'm using a tileview to show a list of images with the ability to reorder and delete images as needed.  The image of what it looks like is attached.

Currently, when I delete an image (which I do by removing an item from the collection) it sets the viewer all the way back to the left and there is no way to programmatically(c#) scroll back to the right where the image was deleted from.

So what I need to understand is how do I set the scroll position of the radtileview?

Here's my view code.
                   
<telerik:RadTileView x:Name="ListView1" MaxRows="1" MaximizeMode="Zero" ScrollBarVisibility="Visible" ColumnWidth="Auto" Height="210"
    TileDragEnded="RadTileView1_TileDragEnded" ItemContainerStyle="{DynamicResource RadTileViewItemStyle}"
    HorizontalContentAlignment="Left"
    SelectionChanged="ListView1_SelectionChanged"  IsItemDraggingEnabled="True"
    IsSelectionEnabled="True"  IsAutoScrollingEnabled="True">                       
    <telerik:RadTileView.ContentTemplate   >                           
        <DataTemplate   >
            <Grid Margin="10,0,10,0" HorizontalAlignment="Left"    >                          
                 <Border  BorderThickness="1" Margin="-2" Background="Transparent" BorderBrush="Black" HorizontalAlignment="Left" VerticalAlignment="Top" >
                    <Border.Effect>
                        <DropShadowEffect ShadowDepth="0" BlurRadius="10"></DropShadowEffect>
                    </Border.Effect>
                    <Image  Height="Auto" Width="Auto"  VerticalAlignment="Top"    Source="{Binding ThumbnailImageControl}"  />
                </Border>
            </Grid>
        </DataTemplate>
         
    </telerik:RadTileView.ContentTemplate>
</telerik:RadTileView>


Here's the style referenced:
<Style x:Key="RadTileViewItemStyle" TargetType="{x:Type telerik:RadTileViewItem}"  >
    <Setter Property="Template" >
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:RadTileViewItem}" >
                <Border x:Name="GripBarElement" Background="Transparent" Width="Auto"  HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid Margin="5"   HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <ContentPresenter x:Name="ContentElement" MouseDown="img_MouseDown"
                                            Grid.Row="1" Width="Auto" HorizontalAlignment="Left" VerticalAlignment="Top"
                                            Content="{TemplateBinding Content}"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"  />
                        <Grid x:Name="ContentCacheHost" Grid.Row="0" Width="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" />
                        <Grid MinHeight="23"  Grid.Row="0">
                            <Button Content="X" Height="23" Margin="0,0,0,0"
                                Width="23" Click="btnDelete_Click"
                                Name="btnDelete"
                                Tag="{Binding FilePath}"  MouseEnter="btnDelete_MouseEnter" MouseLeave="btnDelete_MouseLeave"
                                Foreground="White"  FontSize="14" FontWeight="Bold" Opacity=".4"
                                VerticalAlignment="Top" HorizontalAlignment="Left" >
                                <Button.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#00AF69" Offset="0" />
                                        <GradientStop Color="#138D5D" Offset="1" />
                                    </LinearGradientBrush>
                                </Button.Background>
                            </Button>
                        </Grid>
                    </Grid>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Here's how I bind:
public ObservableCollection<StaticObjects.BmpImage> BitmapImageList { get; set; }

ListView1.ItemsSource = BitmapImageList;

I thought this would work but no luck            
if (currentselectedindex > 0)
{
    ListView1.SelectedIndex = currentselectedindex - 1;
    ListView1.BringIntoView(ListView1.Items[currentselectedindex]);
}

Here's another clue in the delete any ideas?
    void btnDelete_Click(object sender, RoutedEventArgs e)
    {
        Button btn = (Button)sender;
        string filepath = btn.Tag.ToString();
 
        StaticObjects.BmpImage bmp = BitmapImageList.Where(p => p.FilePath == btn.Tag).SingleOrDefault();
 
        int currentidex = ListView1.Items.IndexOf(bmp);
 
        bmp.Dispose();
        BitmapImageList.Remove(bmp);
}
Zarko
Telerik team
 answered on 27 Apr 2012
29 answers
626 views
It looks like your demos all have a handful of points...do you support x-y graphs with thousands of points, like scientific data?
Giuseppe
Telerik team
 answered on 27 Apr 2012
2 answers
181 views
Hi,

I'm trying to follow this example: http://www.telerik.com/help/wpf/radtreeview-how-to-iterate-through-treeviewitems.html .Apparently it allows me to iterate through a RadTreeView.


However, I get the following error:
Error 8 The type or namespace name 'ItemsControl' does not exist in the namespace 'Telerik.Windows.Controls' (are you missing an assembly reference?) 
Robert
Top achievements
Rank 1
 answered on 27 Apr 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?