Telerik Forums
UI for WPF Forum
1 answer
145 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
452 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
95 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
129 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
517 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
84 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
2 answers
59 views
Hello Telerik Team,

I am using a Telerik Hierarchical rad grid.
On the expand changing event of a row in the parent grid, how can I get the instance of the child grid ?

Please suggest.

Regards,
Mausami

Mausami
Top achievements
Rank 1
 answered on 17 Jun 2011
3 answers
459 views
Hi Folks,

I need to be able to get the actual cursor position of the cursor in the text of the DataTimePicker - the SelectionStart and SelectionLength properties that are on the TextBox are not on the RadDatePicker. So, any ideas on how to achieve this?

Thanks
Kendrew
Konstantina
Telerik team
 answered on 17 Jun 2011
3 answers
666 views
Hi,

I need to provide a tooltip on the datgrid coulmn.

Data in the Grid column is in Image format.

ToolTip should change on the basis of Image.

if Image1 , toolTip=A 
Image2 , toolTip=B
Image3 , toolTip=C

Tooltip is in string format.

Please help on this.

Maya
Telerik team
 answered on 17 Jun 2011
1 answer
84 views
Hi,

I have a data pager and I want to make my data pager should support multi language. I am able to implement culture on data pager except page and of string.
I tried with some sample application but I am not able to implement other culture ( French or other) on page and of string.

Can you please resolve my issue as soon as possible.

Regards,
Ravindra
Maya
Telerik team
 answered on 17 Jun 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?