Telerik Forums
UI for WPF Forum
6 answers
316 views
My column footers are summed using an aggregate (SumFunction).
I need to calculate the percent of a grand total represented by the sum of each column. The grand total is calculated as a sum function too.

Essentially I'm looking to do the following: (think Excel)

B5/E5  C5/E5  D5/E5 etc...where E5 is the grand total in the totals column and B5, C5 etc are the sums for their respective columns.

I'm following the pattern for creating a custom aggregate. Here is what I have so far.  What I need is a way to pass the grand total value to the Percent method. Or if that isn't possible some other approach?

public static double Percent<TSource>(IEnumerable<TSource> source, Func<TSource, int?> selector)
{
  return (source.Select(selector).Aggregate(0, (t1, t2) => t1 + (int)t2) * .01);
}
Maya
Telerik team
 answered on 20 Jun 2011
3 answers
134 views
Hi 

Filter with out case sensitive work fine.
But the same items with Different Case come as Different CheckBoxes in the Filter Select Option

eg:
ABD  and abc comes as different filter select options. I want to set this as one.
Is this possible

Rossen Hristov
Telerik team
 answered on 20 Jun 2011
1 answer
386 views
Hi,
I want Show Only Year In DatePicker.

I Set DateSelectionMode="Year".

But When i select a year it show 1/1/year.

i want to only year not 1/1/year

thank`s for Help.
Yana
Telerik team
 answered on 20 Jun 2011
3 answers
194 views

A couple of questions:

1)  The *TRIAL* download page for WPF controls list the following options:

WPF 3.5 - Automatic Installation (msi, 199 MB)
WPF 3.5 - Manual Installation (zip, 193 MB)
WPF 3.5 - DLLs only (zip, 19 MB)
WPF 4 - Manual installation (msi, 92 MB)
WPF 4 - Manual installation (zip, 193 MB)
WPF 4 - DLLs only (zip, 19 MB)

As you can see, There is no "Automatic" installation for the WPF 4 controls? Is that just a typo? is the "WPF 4 - Manual installation (msi, 92 MB)" really supposed to be named "WPF 4 - Automatic installation (msi, 92 MB)"? The link for the payed version appears to label them correctly.

2) the download page also list hot fixes for both 3.5 and 4.0 versions. Do i still have to apply the hot fixes or are they included on the latest full download?

3) If I installed the 3.5 version by mistake and now want to install the 4.0 version. Will the WPF 4.0 installer ask me if I want to upgrade my 3.5 dlls to 4.0 or do I have to do all this manually. If I have to do it manually is there a link that show the steps to follow to make this as painless of a process as possible?

Thank you. 
Milan
Telerik team
 answered on 20 Jun 2011
1 answer
162 views
When setting the RadGridView.SortMemberPath = "SomeMemberName", when the model object raises an INotifyPropertyChanged for SomeMemberName, the grid doesn't seem to re-sort.

Is this the expected behavior?

I'm trying to display dynamically updated data in the grid, where I want to sort the column on some arbitrary member property in the model (e.g. display CPU history in a column and sort on the 10 second average).

How can I make sure that the grid automatically re-sorts when a member in the model is updated?

Thanks,
Alex
Vlad
Telerik team
 answered on 20 Jun 2011
4 answers
476 views
I have this scenario:
 
<
telerik:RadRibbonWindow
   ...
     
    WindowStartupLocation="CenterScreen"
    Title="Xxxxx"
    Height="700"
    Width="980"
    MinHeight="700"
    MinWidth="980"
    Name="XxxxxWindow"
    AutomationProperties.Name="XxxxxWindow"
     
    Closing="XxxxxWindow_Closing"
    >
     
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closed">
            <c:CommandAction Command="{Binding Path=ShellClosedCommand}" SyncOwnerIsEnabled="True" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
     
    <DockPanel SizeChanged="mainRegion_SizeChanged" Name="mainRegionDockPanel" AutomationProperties.Name="mainRegionDockPanel" >       
        <telerik:RadRibbonBar
            DockPanel.Dock="Top"
            prism:RegionManager.RegionName="{x:Static common:RegionNames.RibbonBarRegion}"
            ApplicationName="{Binding Title}"
            HorizontalContentAlignment="Stretch"
            HelpButtonVisibility="Visible"
            HelpRequested="RadRibbonBar_HelpRequested"
            Name="RibbonTitle"
            AutomationProperties.Name="RibbonTitle"
            ApplicationButtonImageSource="{Binding Source={x:Static CommonProps:Resources.Icon_Mario}, Converter={StaticResource bitmapConverter}}"
            >
            <telerik:RadRibbonBar.ApplicationMenu>
                <telerik:ApplicationMenu RightPaneVisibility="Collapsed">
                    <telerik:RadRibbonButton Text="Select/Change Xxxxx/Xxxxx" Click="Xxxxx_Click" />
                    <telerik:RadRibbonButton Text="Close" Click="CloseApplication"/>
                </telerik:ApplicationMenu>
            </telerik:RadRibbonBar.ApplicationMenu>
               <telerik:RadRibbonBar.QuickAccessToolBar >
                <telerik:QuickAccessToolBar >
                     
                    <telerik:RadRibbonButton Text="Export" Size="Small" Command="{Binding ExportToExcelCommand}"
                                                IsEnabled="{Binding ExportToExcelEnabled, UpdateSourceTrigger=PropertyChanged}"
                                                SmallImage="{Binding Source={x:Static CommonProps:Resources.Icon16_Excel}, Converter={StaticResource bitmapConverter}}"/>
                    <telerik:RadRibbonButton Text="Print" Size="Small" Command="{Binding PrintCommand}"
                                                IsEnabled="{Binding PrintSearchEnabled, UpdateSourceTrigger=PropertyChanged}"
                                                SmallImage="{Binding Source={x:Static CommonProps:Resources.Icon16_Print}, Converter={StaticResource bitmapConverter}}" />
                     
                    </telerik:QuickAccessToolBar>
            </telerik:RadRibbonBar.QuickAccessToolBar>
          </telerik:RadRibbonBar>


This is what i get after a couple hours, tha bad thing about this is that the quicklaunch and the minimize, close, etc buttons
 dissapears, any idea why?
<Style TargetType="DockPanel" x:Name="mainRegionDockPanel">
        <Setter Property="Background" Value="{DynamicResource titleBackground}"/>
    </Style>
    
     
    <LinearGradientBrush x:Key="titleBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFE1EBF5" Offset="0.396"/>
        <GradientStop Color="#FFE1EBF5" Offset="1"/>
        <GradientStop Color="#FFC6DFFC" Offset="0.463"/>
        <GradientStop Color="#FFE1EBF5"/>
        <GradientStop Color="#FFD8E7F7" Offset="0.856"/>
    </LinearGradientBrush>
Martin
Top achievements
Rank 1
 answered on 17 Jun 2011
1 answer
106 views
The following code produces a bar chart showing average request amount grouped by year and type:
          
List<RequestData> produceList = new List<RequestData>();
produceList.Add(new RequestData("2", 132, DateTime.Today, "Cash Grants"));
produceList.Add(new RequestData("1", 145, DateTime.Today.AddYears(1), "Cash Grants"));
produceList.Add(new RequestData("3", 149, DateTime.Today.AddYears(1).AddDays(1), "Cash Grants"));
produceList.Add(new RequestData("4", 187, DateTime.Today, "Cash Grants"));
produceList.Add(new RequestData("5", 186, DateTime.Today.AddYears(1), "Matching Gifts"));
produceList.Add(new RequestData("6", 131, DateTime.Today, "Dinners & Events"));
produceList.Add(new RequestData("7", 173, DateTime.Today.AddYears(1), "Dinners & Events"));
produceList.Add(new RequestData("8", 172, DateTime.Today, "Matching Gifts"));
produceList.Add(new RequestData("9", 140, DateTime.Today.AddYears(1), "Cash Grants"));
produceList.Add(new RequestData("10", 129, DateTime.Today, "Dinners & Events"));
produceList.Add(new RequestData("11", 158, DateTime.Today, "Matching Gifts"));
produceList.Add(new RequestData("12", 164, DateTime.Today.AddYears(1).AddDays(1), "Dinners & Events"));
 
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new HorizontalBarSeriesDefinition();
seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Type"));
seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartYearGroupDescriptor("RequestDate"));
seriesMapping.ItemMappings.Add(new ItemMapping("RequestAmount", DataPointMember.YValue, ChartAggregateFunction.Sum));
seriesMapping.ItemMappings.Add(new ItemMapping("RequestDate", DataPointMember.XCategory));
radChart.SeriesMappings.Add(seriesMapping);
radChart.ItemsSource = produceList;
radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";

However, if I change the order of the data so that item 12 comes directly after item 3 like so:
List<RequestData> produceList = new List<RequestData>();
produceList.Add(new RequestData("2", 132, DateTime.Today, "Cash Grants"));
produceList.Add(new RequestData("1", 145, DateTime.Today.AddYears(1), "Cash Grants"));
produceList.Add(new RequestData("3", 149, DateTime.Today.AddYears(1).AddDays(1), "Cash Grants"));
produceList.Add(new RequestData("12", 164, DateTime.Today.AddYears(1).AddDays(1), "Dinners & Events"));
produceList.Add(new RequestData("4", 187, DateTime.Today, "Cash Grants"));
produceList.Add(new RequestData("5", 186, DateTime.Today.AddYears(1), "Matching Gifts"));
produceList.Add(new RequestData("6", 131, DateTime.Today, "Dinners & Events"));
produceList.Add(new RequestData("7", 173, DateTime.Today.AddYears(1), "Dinners & Events"));
produceList.Add(new RequestData("8", 172, DateTime.Today, "Matching Gifts"));
produceList.Add(new RequestData("9", 140, DateTime.Today.AddYears(1), "Cash Grants"));
produceList.Add(new RequestData("10", 129, DateTime.Today, "Dinners & Events"));
produceList.Add(new RequestData("11", 158, DateTime.Today, "Matching Gifts"));
 
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new HorizontalBarSeriesDefinition();
seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Type"));
seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartYearGroupDescriptor("RequestDate"));
seriesMapping.ItemMappings.Add(new ItemMapping("RequestAmount", DataPointMember.YValue, ChartAggregateFunction.Sum));
seriesMapping.ItemMappings.Add(new ItemMapping("RequestDate", DataPointMember.XCategory));
radChart.SeriesMappings.Add(seriesMapping);
radChart.ItemsSource = produceList;
radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";

I get a bar chart with two groupings for the year 2012. Is this a bug or am I doing something wrong?
Tsvetie
Telerik team
 answered on 17 Jun 2011
2 answers
138 views
I would like my GiridView to display a single row that cannot be stretched vertically by it's contents. I tried setting the TextWrapping and TextTrimming properties on the GridViewDataColumn, but it only seems to apply to the very first line of text. If the value contains carraige returns, then the cell grows vertically. I want to have all uniform one line entries.

Thanks,
Rod
Rod Yager
Top achievements
Rank 1
 answered on 17 Jun 2011
5 answers
582 views

I stumbled upon a adding a content to the DropDownContent property of the RadDropDownButton. Particularly I have a problem binding a dependency property of the content element to a property up the logical tree hierarchy. I managed to reproduce the issue in small piece of XAML. It contains a window with a local value “Test” set to its Tag property. There is a TextBlock inside the DropDown button with its property Text bound to the Tag property of the window. When I run the sample I get the following error:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=Tag; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

Another identical TextBlock is placed outside of the DropDown button and its Binding works fine.

I guess that the RadDropDownButton control fails to preserve the logical tree inheritance by not calling
FrameworkElement.
AddLogicalChild method on the DropDownContent element (provided that the content inherits from FrameworkElement). Here is the XAML code:

 

<Window x:Class="WpfApplication14.MainWindow" Title="MainWindow" SizeToContent="WidthAndHeight" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        mc:Ignorable="d" 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"   
        Tag="Test" > 
      
    <Grid Width="200" Height="200">  
        <StackPanel HorizontalAlignment="Left">  
            <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Tag}" Height="22"/>  
            <telerik:RadDropDownButton Content="Drop Down" Height="22" Width="200" DropDownWidth="200">  
                <telerik:RadDropDownButton.DropDownContent> 
                    <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Tag}"/>  
                </telerik:RadDropDownButton.DropDownContent> 
            </telerik:RadDropDownButton> 
        </StackPanel> 
    </Grid> 
</Window> 
 
Allen
Top achievements
Rank 2
Iron
Veteran
 answered on 17 Jun 2011
1 answer
99 views
I am trying to style the background color of the TreeListView items in WPF.
I would like each level to have a darker shade of the previous. I attached a link to ta picture of what I am trying to achieve with this control.

http://i167.photobucket.com/albums/u141/jessica_78610/TreeViewList.png


Is something like this possible with this control, and if so could you help with this, I have been trying to do this using Expression Blend but have been unsuccessful.


Vanya Pavlova
Telerik team
 answered on 17 Jun 2011
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?