Telerik Forums
UI for WPF Forum
2 answers
88 views
Hello,

for our program we use the MVVM-Pattern, so we have some "bindable propertiers". Such like the GroupDescriptorCollection (named DefaultGroupDesciptors) for the GridViews in our forms.

protected override void InitGroups()
{
   DefaultGroupDescriptors = new GroupDescriptorCollection();
 
   GroupDescriptor Descriptor_STKNR = new GroupDescriptor();
   Descriptor_STKNR.Member = "Field1";
   CountFunction cound = new CountFunction();
   Descriptor_STKNR.AggregateFunctions.Add(cound);
   DefaultGroupDescriptors.Add(Descriptor_STKNR);
 
   GroupDescriptor Descriptor_MEAUF = new GroupDescriptor();
   Descriptor_MEAUF.Member ="Field2";
   SumFunction sum = new SumFunction();
   Descriptor_MEAUF.AggregateFunctions.Add(sum);
   DefaultGroupDescriptors.Add(Descriptor_MEAUF);
}


// execut at the binding:
foreach
(GroupDescriptor Elem in DefaultGroupDescriptors)

{
  
     Grid.GroupDescriptors.Add(Elem);

    AddAggregateFunctions(Grid, Elem); 
}

 
private static void AddAggregateFunctions(RadGridView Grid, GroupDescriptor Elem)
{
   if (Elem.AggregateFunctions != null)
   {
      foreach (AggregateFunction Function in Elem.AggregateFunctions)
      {
         Grid.Columns[Elem.Member].AggregateFunctions.Add(Function);
      }
   }
}

The important part:
    Grid.GroupDescriptors.Add(Elem);
    AddAggregateFunctions(Grid, Elem);


This part doubles the AggregateFunctions from the first element:
(
         ...
   CountFunction cound = new CountFunction();
   Descriptor_STKNR.AggregateFunctions.Add(cound);
   DefaultGroupDescriptors.Add(Descriptor_STKNR);
    ...
)

to the seond element
(
    ...
 DefaultGroupDescriptors.Add(Descriptor_MEAUF);
    ...
).

I think a picture is helpful:



If I rotate the "important part", it works...

foreach (GroupDescriptor Elem in newValue)
{
   AddAggregateFunctions(ActGrid, Elem);
   ActGrid.GroupDescriptors.Add(Elem);
}


I hope you can explain me what happens here...

Regards
Arne Z.
Arne
Top achievements
Rank 1
 answered on 30 Aug 2011
1 answer
235 views
Hi,

We're interested in implementing your ImageEditorUI control, and have a few questions concerning its current/future customizability.

First, here's our scenario: within our software, we have a way in which to capture photos using a webcam/camera. We would then like to pass that captured image to your ImageEditorUI before saving the newly edited image to a database. One of the main editing features we'd like our users to see is the ability to "draw" on the loaded image, and possibly add their own text to the loaded image as well.

1. I noticed in the "Event when image is loaded" thread that it was mentioned there is an "upcoming" update to the control. When should we expect this new update, and is there anywhere you could point me to that lists what sort of changes/additions we can expect to see?

2. Are there any plans in the works to add a "drawing" tool to the control, or something in the like? If not, how would you recommend we go about adding this functionality?

3. Since we will be loading the image into the control automatically (without the help of the user), is there/will there be an option to remove the Open File button from the built-in UI?

4. Once the user is ready to save the file, we'd like to bypass the SaveDialogBox and have the file save to a non-user specifide location. Are there plans to make it possible to override this command with our own logic?

Obviously, we could use just the plain ImageEditor without the built-in UI to accomplish 3 and 4. However, we would then have to manually add all of the other tools in order to use them, which seems like a bit of a hassle if we can just remove one button and change the functionality of another.

Thank you for your time,
Kyle
Ivailo Karamanolev
Telerik team
 answered on 30 Aug 2011
3 answers
328 views
Hi,

The problem I have is that I am trying to host a windows form control in a floating pane. Once you start moving the pane around the control disappears. I am reasonably certain that it is because the floating pane window has AllowsTranparency=true. I would like to set it to false.

I tried creating a new style -

<

 

 

Style x:Key="Win" TargetType="telerikDockingControls:RadPane">

 

 

 

 

<Setter Property="AllowsTransparency" Value="False"/>

 

 

 

 

</Style>

but I get the error message -

property was not found in RadePane.

could you tell me how to disable AllowsTransparency please?

 

Miroslav Nedyalkov
Telerik team
 answered on 30 Aug 2011
1 answer
696 views
Hi Telerik,

I'm developing an application using your RadGridView to display a list of production orders with a selection of data. Now I'm facing an issue where some values on the order cannot be bound at compile time, since they can differ depending on the production site that loads the list of orders. For keeping things as simple as possible, consider the following objects that needs to shown in a gridview:
public class SiteOrderHeader
{
    public int SiteOrderId { get; set; }
    public List<MachineSpeed> MachineSpeeds { get; set; }
}
 
public class MachineSpeed
{
    public string Type { get; set; }
    public int Speed { get; set; }
}

Now, the number and values of MachineSpeed is unknown at compile time, but lets assume that during runtime a SiteOrderHeader would be loaded with the following data:

SiteOrderHeader siteOrderHeader = new SiteOrderHeader();
siteOrderHeader.SiteOrderId = 1;
siteOrderHeader.MachineSpeeds.Add(new MachineSpeed() { Type = "Type1", Speed = 10000 });
siteOrderHeader.MachineSpeeds.Add(new MachineSpeed() { Type = "Type2", Speed = 6000 });
siteOrderHeader.MachineSpeeds.Add(new MachineSpeed() { Type = "Type3", Speed = 12000 });


This should result in the following grid layout, where the MachineSpeed types are columns and the speed is the value.
SiteOrderId Type1 Type2 Type3
1 10000 6000 12000
      
All SiteOrderHeader that should be shown in the same grid will have the exact same MachineSpeed types but different values, so I could easily add the columns on runtime, but how can I map the speed values to the corrosponding type?

I would prefer if this could be databound in some way during runtime without the need of knowning the MachineSpeed types.
Please guide on suggested way to do this with RadGridView. I can also change the class layout of SiteOrderHeader and MachineSpeed if this could be build in a way that fits into RadGridView, i.e. use a Dictionary<string, int> for the MachineSpeed definition..

Any help would be much appriciated.

Best regards,
Kasper Schou
Nyami
Top achievements
Rank 1
 answered on 30 Aug 2011
1 answer
96 views
Hi,

I'm hiding a floating pane by setting the IsHidden property to false. If I show it again by setting the IsHidden property to true, I expect that the pane is a again in the RadDocking.Panes collection. But it isn't. This behaviour is different to previous releases. Do you intend to fix it?

Best regards

Uli
Miroslav Nedyalkov
Telerik team
 answered on 30 Aug 2011
1 answer
109 views
Hi,

I downloaded the latest version of Telerik WPF demo and was trying the Dlls in one of my project. The project already refers to old Telerik dlls. Wanted to replace it with a new ones. Here is the exception I'm getting on referencing the GridView..

Error 36 CA0001 : Could not find type 'Telerik.Windows.Data.IDisplayProvider' in assembly 'Telerik.Windows.Controls.GridView, Version=2011.2.712.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7'.  

Any idea what dll reference Im missing here? Following are the dlls I added in the project:
Telerik.Windows.Controls
Telerik.Windows.Controls.Docking
Telerik.Windows.Controls.GridView
Telerik.Windows.Controls.Input
Telerik.Windows.Controls.Navigation
Telerik.Windows.Data
Vlad
Telerik team
 answered on 30 Aug 2011
2 answers
174 views
Hello Telerik Team,


I am using the WPF RAD TreeListView version 2011.1.419.35 and trying to export multi level data to excel. (ExcelML format)

I have a couple of questions:

  1. Does this control support exporting the expanded child rows indented in excel? I would love to add the indent to the export.
    The indent should only be on the cells in the first row if possible

  2. A few columns are bound to a StatusDouble object that has a double value and a string status, while the UI Celltemplate I use display the double value from the underlying object, the data export ends up spitting out the .ToString() on that object which ends up showing up on the excel like this 'Value: -6499 Status: Ok'. I want it to export -6499

Thanks for your help in advance
- Kumar
Vlad
Telerik team
 answered on 30 Aug 2011
20 answers
348 views

Hi everyone,

I am glad to announce the first public build of the upcoming RadDocking Q2 2011, which is intended to address the performance issues in the control under Windows XP and/or high resolutions (WPF). The changes we have made in both the Silverlight and the WPF versions are fairly large and we would like to get as much feedback as possible, so please try the attached assemblies and drop us a line. We are willing to fix all reported bugs by the upcoming official beta release next month and we will not hesitate to give you Telerik points.

What's changed:
- we replaced the base class of ToolWindow, so now the tool windows are not displayed in a large transparent window (the cause of the performance problems), but each of them has a small native window.
- we fixed a frequently reported memory leak.

What's new:
- the tool windows now support the Windows 7 gestures for maximize, minimize, etc.
- ActivePane
- Ability to customize the drag-drop
- Bugfixes

What's coming for the beta
- fixes for a lot of bugs, logged in the PITS, so now is a good time to vote for them.

What does not work now:
- we are aware of several minor bugs and glitches, but please let us know if you find something, as we might have missed it.

The attached assemblies are built against Q1 2011 SP1, so you should be able to test the control in your existing application. We can provide assemblies built against the latest internal builds on demand.


Update: Attached a .NET 4 build.

Update (May 31): Pre-beta 2 binaries.
Update (May 31 -#2): Reuploaded the binaries.


Regards,
Valeri Hristov
Telerik
Miroslav Nedyalkov
Telerik team
 answered on 30 Aug 2011
1 answer
75 views
Hello everyone, 

I was the Simple filtering for a RadChart that telerik has in it's examples and could not get it working from the code behind. I got the filtering working if I hard code the datapoints in the xaml document, but not if I randomly generate them from the code. I know I am missing how to bind the ViewModel and give it the visibility method in the code, I believe that is all I am missing. Any thoughts?

Xaml Code:
<Window.Resources>
        <example:ExampleViewModel x:Key="ViewModel" />
        <Style x:Key="CustomLegendItemStyle" TargetType="telerik:ChartLegendItem">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Template" >
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:ChartLegendItem">
                        <Grid x:Name="PART_MainContainer" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,0,5,0">
                            <Path x:Name="PART_LegendItemMarker"
                                  Height="20"
                                  Width="*"
                                  Style="{TemplateBinding ItemStyle}"
                                  Stretch="Fill">
                                <Path.Data>
                                    <PathGeometry x:Name="PART_ItemMarkerGeometry" />
                                </Path.Data>
                            </Path>
                            <CheckBox IsChecked="True"
                                      VerticalAlignment="Center"
                                      Margin="2,0"
                                      Content="{TemplateBinding Label}"
                                      Foreground="{TemplateBinding Foreground}"
                                      Command="{Binding Path=ChangeSeriesVisibilityCommand, Source={StaticResource ViewModel}}"
                                      CommandParameter="{TemplateBinding Label}"
                                      />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
            <telerik:RadChart x:Name="RadChart1">
                <telerik:RadChart.DefaultView>
                    <telerik:ChartDefaultView ChartLegendPosition="Top">
                        <telerik:ChartDefaultView.ChartLegend>
                            <telerik:ChartLegend x:Name="PrimaryLegend" Header="Click on country to hide/show:" LegendItemMarkerShape="Square" LegendItemStyle="{StaticResource CustomLegendItemStyle}" Foreground="Black" HeaderFontWeight="Normal" FontFamily="Segoe UI" />
                        </telerik:ChartDefaultView.ChartLegend>
                        <telerik:ChartDefaultView.ChartArea>
                            <telerik:ChartArea Padding="5,10,20,5" LabelFormatBehavior="None" LegendName="PrimaryLegend" />
                    </telerik:ChartDefaultView>
                </telerik:RadChart.DefaultView>
            </telerik:RadChart>
        <TextBlock Grid.Row="1" x:Name="sourceText" TextAlignment="Right" Text="Source: Eurostat" FontSize="10" Foreground="{Binding Source={StaticResource ViewModel}, Path=ApplicationThemeAwareForeground}" />
    </Grid>
    </Window>

Code behind:
Random rnd = new Random();
        public Example()
        {
            this.InitializeComponent();
             
            var ds = new DataSeries();
            for (var x = 1; x <= 14; ++x)
            {
                ds.Definition = new LineSeriesDefinition();
                ds.Definition.ItemLabelFormat = "0.#";
                ds.Definition.Visibility = SeriesVisibility.Visible;
                ds.LegendLabel = x.ToString();
                var dp = new DataPoint { YValue = this.rnd.Next(10) + 1 };
 
                if (x == 3 || x == 7)
                {
                    dp.IsEmpty = true;
                }
                ds.Add(dp);
            }
 
            this.RadChart1.DefaultView.ChartArea.DataSeries.Add(ds);
        }
Ves
Telerik team
 answered on 30 Aug 2011
4 answers
266 views
Hello,
Was wondering if someone could help answer a question.

I'm trying to create a main window with a collapsed panelbar at the top, both sides, and the bottom that each contain buttons.
I've managed to get the layout I'm looking for, but the issue is the expansion of the top and left panel bars.
The top bar expands leaving the panel bar header at the very top, and the left side expands with the content upside down (header moves toward the center which is what I want).

What I'm looking for is when all 4 sides are expanded, Panel bar item header will move towards the center making a nice "Boxed in" area in the center of the screen....

I've changed aligntmet, flow direction, etc and I can't get the top to flow correctly and the left to have the contents right side up...

Wish I could post a pic, but this is the best I can describe.  I posted the XAML in case this helps.

Thanks for any help.

TOP

<

 

 

telerik:RadPanelBar Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Name="radPanelBar2" VerticalAlignment="Bottom" Width="Auto" Orientation="Vertical" DropExpandDelay="00:00:02" Background="#FFE7E9E7" FlowDirection="RightToLeft" VerticalContentAlignment="Top">

 


LEFT

 

 

 

<telerik:RadPanelBar Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Height="Auto" HorizontalAlignment="Left" Name="radPanelBar3" VerticalAlignment="Stretch" Width="Auto" Orientation="Horizontal" HorizontalContentAlignment="Left" FlowDirection="RightToLeft" DropExpandDelay="00:00:02" Background="#FFE7E9E7">

 


RIGHT

<

 

 

telerik:RadPanelBar Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" Height="Auto" HorizontalAlignment="Right" Name="radPanelBar1" VerticalAlignment="Stretch" Width="Auto" Orientation="Horizontal" Background="#FFE7E9E7">

 


BOTTOM

<

 

 

telerik:RadPanelBar Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Name="radPanelBar4" VerticalAlignment="Bottom" Width="Auto" Orientation="Vertical" Background="#FFE7E9E7">

 

Jeff
Top achievements
Rank 1
 answered on 29 Aug 2011
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?