Telerik Forums
UI for WPF Forum
1 answer
152 views

Hi,

 I'm building a DLL which include multiples usercontrols and multiples Telerik Controls and I would like to know if it's possible to define the Office2013 theme at one place for my whole DLL instead of declaring it in each usercontrol which contain a Telerik Control???

 

Thank's

Alain

Vanya Pavlova
Telerik team
 answered on 10 Apr 2015
7 answers
738 views
Hi

I have a gridview which is supposed to show the Nace codes of companies. A Nace Code consists of two strings: The Code and the Name (the Code is a number, but it's type is a string).

In the cells, I want to write: "Code: Name". When the user sorts this column, I want the sorting to be on the Code.
For instance:
3012: Boots- und Yachtbau
9311: Betrieb von Sportanlagen

When the nace code is grouped, I want the headers to be "Name (Code)". When the user sorts the groups, I want the sorting to be on Name:
For instance:
Bibliotheken und Archive (9101)
Boots- und Yachtbau (3012)

I have an Entity with a property named NaceCodeObject which has 2 properties: NaceCode and IndustryName

I can create a GridViewDataColumn which - by the way of a converter and concarding the two properties into a single string - shows me the data I want in the Group header and in the cell. But it seems like SortMemberPath uses the value DataMemberBinding, not the value of the group header for sorting the groups.

How can I solve this problem? Is there any way to sort a column one way when just displaying the rows and another way when grouping?
Dimitrina
Telerik team
 answered on 10 Apr 2015
7 answers
570 views
Hi,

I'm trying to use approach described here (http://www.telerik.com/community/forums/winforms/property-grid/binding-to-datatable.aspx) with wpf RadropertyGrid.

In my scenario, I have an API that returns list of properties for particular instance. That means that properties are resolved at runtime for particular instance. Each instance can have different properties.
*property is described as PropertyName (string), PropertyValue (string), PropertyType(enum).

CustomTypeDescriptor is ideal solution for me. I can map the PropertyType enum to .net types and convert the PropertyValues from strings to strongly-typed values. This way I can benefit from auto generated propertygrid and default editortemplates.

The only problem is, that wpf RadPropertyGrid invokes TypeDescriptionProvider just with Type, and don't pass object instance as parameter. You should use TypeDescriptor.GetProperties(object instance) instead of TypeDescriptor.GetProperties(Type type).
  [TypeDescriptionProvider(typeof(Mono3DPropertiesTypeDescriptorProvider))]
  public class Mono3DPropertiesWrapper 
  {
    public readonly Monogram.Mono3D.Control Control;
 
    public Mono3DPropertiesWrapper(Monogram.Mono3D.Control control)
    {
      if (control == null)
      {
        throw new ArgumentNullException("control");
      }
      Control = control;
    }
}
 
 
  public class Mono3DPropertiesTypeDescriptorProvider : TypeDescriptionProvider
  {
    public Mono3DPropertiesTypeDescriptorProvider()
      : base(TypeDescriptor.GetProvider(typeof(Mono3DPropertiesWrapper)))
    {
    }
    public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
    {
        //HERE IS THE PROBLEM: instance IS NULL. CALLSTACK IS BELLOW
      return new Mono3DPropertiesTypeDescriptor(instance);
    }
  }
 
 
 
  public class Mono3DPropertiesTypeDescriptor : CustomTypeDescriptor
  {
    private readonly object instance;
    public Mono3DPropertiesTypeDescriptor(object instance)
    {
      this.instance = instance;
    }
      ...
  }


In this callstack you can see that you use TypeDescriptor with object's type insead of instance:

> LayoutDesigner.dll!Monogram.Sport.ShowDesigner.LayoutDesigner.Internals.Mono3DPropertiesWrapper.Mono3DPropertiesTypeDescriptorProvider.GetTypeDescriptor(System.Type objectType, object instance) Line 39 C#
  System.dll!System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties() + 0x4d bytes 
  System.dll!System.ComponentModel.TypeDescriptor.GetProperties(System.Type componentType) + 0x2e bytes 
  Telerik.Windows.Data.dll!Telerik.Windows.Data.ItemPropertyInfoHelper.GetPropertyDescriptors(Telerik.Windows.Data.QueryableCollectionView collectionView) Line 90 + 0x11 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.ItemPropertyInfoHelper.CreateItemProperties(Telerik.Windows.Data.QueryableCollectionView collectionView) Line 41 + 0x9 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.GetItemProperties() Line 40 + 0x9 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.ItemProperties.get() Line 31 + 0xf bytes C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadPropertyGrid.ItemProperties.get() Line 724 + 0x27 bytes C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadPropertyGrid.GeneratePropertyDefinitions() Line 747 + 0x9 bytes C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadPropertyGrid.RebindPropertyDefinitions(Telerik.Windows.Controls.RadPropertyGrid propertyGrid) Line 667 + 0xb bytes C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadPropertyGrid.OnItemPropertyChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs args) Line 581 C#
Dimitrina
Telerik team
 answered on 10 Apr 2015
1 answer
166 views

Hi

I'm using RadBook and Pdf viewer as follow:

 Xaml Code:

<UserControl.Resources>
    <DataTemplate x:Key="LeftPageTemplate">
        <Viewbox>
            <Grid>
                <UI:FixedDocumentSinglePagePresenter Page="{Binding}"  Width="325" Height="447" FlowDirection="LeftToRight"/>
                <hosts:DrawingCanvas  Width="325" Height="447" Margin="15" Background="#00000000" FlowDirection="LeftToRight" />
            </Grid>
        </Viewbox>
    </DataTemplate>
</UserControl.Resources>
 
<telerik:RadBusyIndicator x:Name="BusyIndicator">
    <telerik:RadBook x:Name="book"
                 LeftPageTemplate="{StaticResource LeftPageTemplate}"
                 RightPageTemplate="{StaticResource LeftPageTemplate}"
                 IsVirtualizing="True"
                 IsKeyboardNavigationEnabled="True"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 FirstPagePosition="Right"
                 HardPages="None"
                 Margin="10"
                 BorderThickness="1"
                  BorderBrush="{telerik:Windows8Resource ResourceKey=BasicBrush}"/>
</telerik:RadBusyIndicator>

C# Code:

public void LoadFile(Stream stream)
{
    BusyIndicator.IsBusy = true;
 
    var UISyncContext = TaskScheduler.FromCurrentSynchronizationContext();
 
    var task = new Task<RadFixedDocument>(() => LoadPdf(stream));
    task.ContinueWith(t =>
    {
        book.ItemsSource = t.Result.Pages;
        TotalPages = t.Result.Pages.Count;
 
        BusyIndicator.IsBusy = false;
 
    }, UISyncContext);
    task.Start();
}
 
private RadFixedDocument LoadPdf(Stream stream)
{
    return new PdfFormatProvider(stream, FormatProviderSettings.ReadOnDemand).Import();
}

Everything seems to work fine!

But the problem is when I Load a file and start browsing pages, and monitor it on Task Manager, memory grows too high (i.e. more than 2GB)

Look at the attached files, one from Task manager and one from ANTS Memory Profiler!

 What's wrong with my code? Should I do some extra work like releasing objects, pages, ... any thing!?

Peshito
Telerik team
 answered on 10 Apr 2015
2 answers
103 views

When using the Telerik example from http://docs.telerik.com/devtools/wpf/controls/dragdropmanager/how-to/howto-draganddrop-within-radgridview.html dragging an item to the empty space in the RadGridView causes the row to go to the top of the list. Is this the desired behavior? Is there a way to disable it?

 I have attached a picture of dragging to the whitespace. The "spike" row is the last row. If I drag the "spike" row to the bottom whitespace, the "spike" row will become the top row in the list.

Dimitrina
Telerik team
 answered on 10 Apr 2015
3 answers
183 views
Your have a fantastic suite of products.  Congrats from a 35 year veteran of application development (think COBOL)...    Your documentation/examples are prolific and very helpful, but as a relative newcomer to both WPF/XAML (as well as Telerik)  I am having a hard time using many of the code samples in conjunction with others.  Some are operating in different contexts from others and have underlying schemes using seemingly incompatible techniques.   Not a criticism, but trying to be helpful to your already excellent support. 

I'm trying to do 3 things, and I've at least attempted to build and execute the following examples ( as well as several from the awesome Demo UI). Although I've been able to produce all of these individually from demo/sample code, I have not been able to combine them all successfully to meet my requirements.  

http://www.telerik.com/forums/locate-a-shape-and-change-size-according-to-zoom-level
http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/shape-appearance.html
http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/virtualization.html
http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/heatures-clustering.html
http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/data-binding.html
http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/map-shape-data.html

What I'm trying to do is 
  * Use C# code to build the list of items to render.  Most sample code has hard coded items (ellipses, rectangles, pin points, etc)  , and when I introduce DataContext and ItemTemplate And ItemsSource, and Resource etc, either the xaml pre-processing in VS design time throws errors or the executing code doesn't work. 
  * I need to use the virtualization techniques so that at low zoom levels, the user can see shapes (ellipses), and when zooming in, the shapes remain the same size on the screen, i.e. don't end up being bigger than entire cities.  (http://www.telerik.com/forums/locate-a-shape-and-change-size-according-to-zoom-level) 
  * I need to be able to respond to a user click on a shape and change the appearance to be "selected", i.e. HighlightShapeFill  using the method in http://docs.telerik.com/devtools/wpf/controls/radmap/features/visualization-layer/shape-appearance
  * I'm also probably going to need clustering, but I haven't tried messing around with that concept yet.

I'm not sure what code to post for you to review ... I've got all of this stuff working individually,  I haven't been able to combine them into a single code base. 

Our basic architecture and business is: 
  * The Map control has a VisualizationLayer, and the code behind assigns the ItemsSource to a public property (ObservableCollection of "MapItems")  in the constructor.  This collection get added to no problem, the shapes show up as expected on the map.
  * There are a number of different types of items to render, each type will has a set of appearance attributes as defined in a database, such as fill color, stroke color, size, and in some cases perhaps shape (ellipses vs. square, vs polygon, etc)  
  * When user asks for "nodes" to be placed on map, the C# code creates a new  "MapItem" object with appropriate properties, adds it to the collection of MapItems which are the ItemsSource to the VisualizationLayer.  In the current set up the layer has an ItemTemplate which has a DataTemplate, which binds to MapItem properties for color, size etc.   This works fine by itself.   It's just when I try to bring in the ShapeFill (Highlighted) stuff, and the Virtualization stuff .. nothing works .. at all. 

p.s. thanks for putting up with all of us English speakers and for showing you own neighborhood in many of the examples.  We here in the U.S. need that ;=)  .. badly.  Any hints would be most appreciated. 

благодаря

NOTE:  As it is, we are not able to effectively use INotify in .Net to truly bind WCF UI components.  We are running under some higher level Microsoft frameworks that seem to be interfering (Prism).  So for now all of our code has to run in the code behind, constantly resetting DataContexts and ItemsSources to refresh the UI... ugly, yes, and hopefully resolved before too long. ;-)












Rajinder
Top achievements
Rank 1
 answered on 10 Apr 2015
3 answers
262 views
Hello everybody,
is it possible to define dynamic pages on the RadWizard Control or create the pages based on a List/Observable collection?

I would like, based on a property, to create or skip the WizardPages...

Many thanks for the answer
Dino
Stefan
Telerik team
 answered on 09 Apr 2015
1 answer
136 views

This is a usability issue with the Wizard. 

 I think it would be better to have the Finish button where the Cancel button currently is on the last page of the Wizard.

 This is because users (and I certainly do) will mistakenly tend to click in the same place as Next to complete what they have been doing, only to find that they have actually cancelled the wizard and possibly lost all their processing.

 

This would also make the Telerik wizard consistent with other kinds (e.g. Installation wizards).

 

 

 

Yoan
Telerik team
 answered on 09 Apr 2015
1 answer
62 views

Hi,

 Suppose that I want to implement custom IAppointment, IRecurrenceRule, IExceptionOccurrence. (for database purpose for sample like explain in your documentation). I don't want inherited from telerik class but implement myself interfaces.

 If I want to add feature to export schedule in ics format, I can use your helper to do that like this :

 

AppointmentCalendarExporter exporter = new AppointmentCalendarExporter();
exporter.Export(this.Appointments.OfType<IAppointment>(), txtWriter);

 

But your exporter make assumption on IExceptionOccurence and try to cast it in telerik class, and in my case it raise an exception :

"Impossible d'effectuer un cast d'un objet de type 'CustomExceptionOccurenceModel' en type 'Telerik.Windows.Controls.ScheduleView.ExceptionOccurrence'."

This behaviour is not really in phase with Appointment and RecurrenceRule, the helper don't suppose that IAppointment and IRecurrenceRule are telerik class. With do you have exception for IExceptionOccurrence ?

Regards

Luc

Kalin
Telerik team
 answered on 09 Apr 2015
4 answers
164 views
Hi,
Is there any limit for tree layout? There are 1100 items and 1200 connections in the diagram. And when applying layout throw stackoverflowexception. Sugiyama Layout working correctly. And tree layout working small diagram( 10 Items, 9 Connections). But in large one, not working. I believe Tree DataStructure function generally recursive one. So It caused the StackoverflowException.
Thanks in advance.
Petar Mladenov
Telerik team
 answered on 09 Apr 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
PersistenceFramework
DataPager
Styling
TimeBar
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?