Telerik Forums
UI for WPF Forum
12 answers
297 views
RadDataForm is really nice when binding to data with simple properties (int, string, bool, ...) but now I stuck while binding it to an entity type which has a collection of entities from another type. Let's assume there is a class Category with Fields ID (of type int) and Name (of type string) but also a property of type List<Product>.

I use a RadListBox with a custom DataTemplate to show the products (inside RadDataForm EditTemplate) but when I edit values of a product the RadDataForm does not recognize that changes as it only checks for edits at the bound object (which is the Category but not the related products). Is this possible with RadDataForm? How can I tell my RadDataForm (manually) that the CurrentItem has changed?
Jackey
Top achievements
Rank 1
 answered on 11 Apr 2015
0 answers
89 views

Hi team,

In order to make my problem clear, I would list what I've done currently.

1. I am using MVVM, so I have view models of nodes, links and a graph source. All these implementations follow the guideline of RadDiagram MVVM. And it works fine.

2. Then I want to define some custom connectors. According to this thread, I manage to add custom connectors to my digram.

3. The solution of that thread mentioned above is using a attached property. And I also have a requirement: I need to remove or add nodes runtime. So I have following codes

 

if (this._graphSource == null)
{
    this._graphSource = new LineGraph();
}
 
this._graphSource.Clear();
this._graphSource.PopulateGraph(this);
return this._graphSource;


And when my application starts up for the first time, the offsets of the custom connectors work properly. However, when I add or remove nodes, the above if statement wouldn't be executed, it would clear all the nodes existed, and re-populate the graph again. However, the offsets don't take effect now. Removing the if statement, then the offset works no matter I add or delete nodes.

The key is I don't want to create the LineGraph object each time I delete or add nodes. 

Hope make myself clear.

Best Regards,

Jingfei

Jackey
Top achievements
Rank 1
 asked on 11 Apr 2015
1 answer
66 views

Is it possible to specify the fill direction explicitely?

At the moment, when displaying an Area series, the series is filled between the graph and zero. However, I sometimes need the filled area to be above or below the graph, independent of the actual value.

Alex

Peshito
Telerik team
 answered on 10 Apr 2015
1 answer
225 views

Where can I find source code of RadControl's WPF demo? I have already downloaded and installed demo on my local system. I am looking for a Visual Studio 2013 project solution.

 

Thanks.

Dimitrina
Telerik team
 answered on 10 Apr 2015
1 answer
50 views

This may be about JustCode but its really about WPF.  So, move this entry if you think it'd be better serviced elsewhere.

Do you have a tool that will highlight Binding errors?  I realize that Binding is hard because its not until the control is bound that we know if it worked or not.  Right now, the only way to tell is by watching Visual Studio's lame Output  window... then, its hard to spot the exceptions. 

Even if it is after the code is started, it'd be awesome to have a tool that would list and allow navigation to controls that encountered a Binding error.

Thanks,

Joel

Dimitrina
Telerik team
 answered on 10 Apr 2015
1 answer
143 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
699 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
538 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
153 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
102 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?