Telerik Forums
UI for WPF Forum
5 answers
105 views
I just updated to the newest version and went through the release note. The change "Column aligned aggregates" in GridView caught my interest, but I seem to be unable to find anything usefull when I search for that term anywhere (also in the documentation).

There were no link in the release note to take me to a detailed description of this change.

How and where do I find the documentation of this?

Thanks
Dimitrina
Telerik team
 answered on 23 Jan 2013
1 answer
271 views
Hey there, I'm creating a project where I want to display attributes of specific objects in a chart. For example, I have 2 different loan objects (Current Loan and Proposed Loan) and I want to display each one of those object's "Tax Savings" in a bar chart. I am trying to do something EXACTLY like this:

http://www.telerik.com/help/wpf/radchartingkit-series-barseries.html 

But I want the properties themselves to be properties on my objects. I've tried basic bindings and I can't seem to get it to work. The objects bind find throughout my app it's just not functioning here. The code I've got is:

                            <telerikChart:RadCartesianChart Width="500" >

                                <telerikChart:RadCartesianChart.HorizontalAxis>
                                    <chartView:CategoricalAxis/>
                                </telerikChart:RadCartesianChart.HorizontalAxis>
                                
                                <telerikChart:RadCartesianChart.VerticalAxis>
                                    <chartView:LinearAxis/>
                                </telerikChart:RadCartesianChart.VerticalAxis>

                                <telerik:BarSeries>
                                    <telerik:BarSeries.DataPoints>
                                        <telerik:CategoricalDataPoint  Value="{Binding Path=CurrentLoan.TaxSavings}"
                                                  Category="Proposed Loan"/>
                                        <telerik:CategoricalDataPoint  Value="{Binding Path=ProposedLoan.TaxSavings}"
                                                  Category="Current Loan"/>
                                    </telerik:BarSeries.DataPoints>
                                </telerik:BarSeries>

                            </telerikChart:RadCartesianChart>

When It loads, it actually blanks out my entire "View" that the charts are supposed to be in. Any suggestions? Thank you
Ves
Telerik team
 answered on 23 Jan 2013
3 answers
173 views
I'm currently evaluating TreeListViews from various vendors and am trying to determine if what I'm looking for is possible. We are using an MVVM model for our code. That being said I have a view model that has a collection of items. Each item has a collection of children and a collection of additional properties. Below is some sample code:

public class PsuedoClass
{
    public IObservableCollection<IBaseClass> Parents { get; set; }     
}
 
public class Parent : IBaseClass
{
    public String Name { get; set; }
    public IObservableCollection<IBaseClass> Children { get; set; }
    public IDictionary<string, string> OtherData { get; set; }
}
 
public class Child : IBaseClass
{
    public String Name { get; set; }
}
 
public interface IBaseClass
{
    String Name { get; set; }
}

Now obviously this code isn't complete, but I wanted to give you an idea of the basic structure. Now I want to display this in a TreeListView where each row has a choice of a couple templates, one template for if its a Parent, the other if its a child. And then I want the columns to be bound to the "OtherData" in the Parents class (Meaning, I want the Header to be the "Key" in the dictionary and the data to be the "Value" of the dictionary, or some similar structure).

What I would like to be able to do is something like this:
<UserControl ... >
    <UserControl.Resources>
        <DataTemplate x:Key="ChildItemTemplate">
            <TextBlock Text="{Binding Name}"/>         
        </DataTemplate>
     
        <HierarchicalDataTemplate x:Key="ParentItemTemplate"
                                  ItemsSource="{Binding Children}"
                                  ItemTemplate="{StaticResource ChildItemTemplate}">
            <TextBlock Text="{Binding Name}"/>
             
            <SomeHowDisplayTheRestOfTheColumns/>
             
        </HierarchicalDataTemplate>
    </UserControl.Resources>
 
    <telerik:RadTreeListView ItemsSource="{Binding Parents}"
                             Columns="{Binding SomePropertyThatExposesOurColumns}"
                             ItemTemplate="{StaticResource ParentItemTemplate}">   
    </telerik:RadTreeListView>
</UserControl>


Any insight into if this is possible with examples would be greatly appreciated. Thanks in advance.
Dimitrina
Telerik team
 answered on 23 Jan 2013
7 answers
196 views

Hi,
Jag have an existing Custom Theme for RadGridView which is not entire correct because in
<ControlTemplate x:Key="GridViewGroupPanelItemTemplate" TargetType="grid:GridViewGroupPanelItem">
Content
="{Binding Path=DisplayContent}" doesn't get any value. I think it something is missing in our GridViewTheme.xaml. Would be very grateful for any tip.
Best regards
Elena


<ControlTemplate x:Key="GridViewGroupPanelItemTemplate" TargetType

="grid:GridViewGroupPanelItem">

 

  <StackPanel x:Name="PART_GroupPanelItemStackPanel" Orientation="Horizontal"
    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
        Background="Transparent">
    <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment }"> 

        <Grid.RowDefinitions>
            <RowDefinition MinHeight="4" Height ="Auto" /> <RowDefinition />
        </Grid.RowDefinitions>

        <Path Name="PART_InsertionPoint" Grid.Row="0" Visibility="Collapsed"
        
Fill="{StaticResource GridView_IndicatorPrimaryColor}" Stretch="Fill" 
        
VerticalAlignment="Top" HorizontalAlignment="Center" Width="6.414" 
        Height
="4.677" 
        Data
="M206.66812,170.31108 L212.08199,170.31108 209.36058,173.98834 z" />
        
<Grid x:Name="PART_ConnectingLine" Visibility="Visible" Grid.Row="1" 
        Margin
="{TemplateBinding Padding}">
            <Path Fill="{StaticResource GridView_IndicatorSecondaryColor}" 
            Stretch
="Fill" Stroke="{x:Null}" Width="4" Height="7"  Margin="1,2,0,0"
            Data
="M0,0 L1,0 1,1 2,1 2,2 3,2 3,3 4,3 4,4 3,4 3,5 2,5 2,6 1,6 1,7 0,7 z"/>

            <Path Fill="{StaticResource GridView_IndicatorPrimaryColor}" Stretch="Fill"
            Stroke="{x:Null}" Width="4" Height="7" 
            Data
="M0,0 L1,0 1,1 2,1 2,2 3,2 3,3 4,3 4,4 3,4 3,5 2,5 2,6 1,6 1,7 0,7 z"/>

        </Grid>
    </Grid>
    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder}"
       Background
="{TemplateBinding Background}" BorderThickness="1" CornerRadius="3" 
        
Margin="5,0">
        <grid:GridViewGroupPanelCell Background="Transparent" BorderThickness="0" 
       
Content="{Binding Path=DisplayContent}" Foreground="Black" Padding="12,0,12,2" 
       
SortDirection="{Binding Path=SortDirection}"/>
    
</Border>
</StackPanel>
</ControlTemplate

>

 

 

 

 

Oliver
Top achievements
Rank 1
 answered on 23 Jan 2013
2 answers
162 views
Telerik Support,

When a user has the DropDown to a ComboBox open, it becomes impossible to focus/click on any other element (seemingly in the entire program) until the DropDown is closed.  I understand that this is the standard behavior even with the regular WPF ComboBox control, so what I'm wondering is if there's any way to change this behavior.

Thanks,

Kyle
intellitechcorporation
Top achievements
Rank 1
 answered on 22 Jan 2013
1 answer
230 views
I am binding my radtreeview to a collectionviewsource that is grouped on the employee's last name initial (A, B, C, etc.).  I also bind the selecteditem to a property on my viewmodel which is of type Employee.  The problem is that when I select the parent node (A, B, C, etc.) it fails validation and gives me a red border.  I want to override that and disable it.

Private _selectedItem As Library.EmployeeInfo
Public Property SelectedItem As Library.EmployeeInfo
    Get
        Return _selectedItem
    End Get
    Set(ByVal value As Library.EmployeeInfo)
        If IsBusy Then Return
        _selectedItem = value
        NotifyOfPropertyChange(Function() SelectedItem)
        Events.Publish(New SelectionChangedEvent(Of EmployeeListViewModel, Library.EmployeeInfo) With {.Source = Me, .Obj = Me.SelectedItem})
    End Set
End Property


    <Grid.Resources>
        <bengenconv:SingleCharacterConverter x:Key="SingleCharacterConverter" />
        <CollectionViewSource x:Key="Emps"
                              Source="{Binding Model}">
            <CollectionViewSource.SortDescriptions>
                <componentModel:SortDescription PropertyName="Lastname" />
                <componentModel:SortDescription PropertyName="Firstname" />
                <componentModel:SortDescription PropertyName="EmployeeIdNumber" />
            </CollectionViewSource.SortDescriptions>
            <CollectionViewSource.GroupDescriptions>
                <PropertyGroupDescription PropertyName="Lastname"
                                          Converter="{StaticResource SingleCharacterConverter}" />
            </CollectionViewSource.GroupDescriptions>
        </CollectionViewSource>
        <DataTemplate x:Key="EmployeeTemplate">
            <TextBlock>
                <TextBlock.Text>
                    <MultiBinding StringFormat="{}{0}, {1}">
                        <Binding Path="Lastname" />
                        <Binding Path="Firstname" />
                    </MultiBinding>
                </TextBlock.Text></TextBlock>
        </DataTemplate>
        <HierarchicalDataTemplate x:Key="GroupsTemplate"
                                  ItemsSource="{Binding Items}"
                                  ItemTemplate="{StaticResource EmployeeTemplate}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Name}"/>
                <TextBlock Text="{Binding ItemCount, StringFormat='  ({0})'}"
                           FontSize="11"
                           FontStyle="Italic"
                           Foreground="DimGray"
                           VerticalAlignment="Center"/>
            </StackPanel>
        </HierarchicalDataTemplate>
    </Grid.Resources>
    <telerik:RadTreeView x:Name="xTreeView"
                         ItemsSource="{Binding Source={StaticResource Emps}, Path=Groups}"
                         Grid.Row="1"
                         Padding="5"
                         BorderThickness="0"
                         IsEditable="False"
                         SelectionMode="Single"
                         SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                         ItemTemplate="{StaticResource GroupsTemplate}"
                         IsSingleExpandPath="True"
                         IsExpandOnSingleClickEnabled="True">
    </telerik:RadTreeView>
</Grid>
cman
Top achievements
Rank 1
 answered on 22 Jan 2013
1 answer
171 views
hi,

I am using RadDateTimePicker (version: RadControls for WPF Q3 2012) in my WPF app.  The RadDateTimePicker looks fine when I have the TimeInterval property set as "0:30", but when I set it to "0:05", the time selector part of the RadDateTimePicker becomes blank. please see my attachment. Any idea how to resolve that?

thanks in advance
Boyan
Telerik team
 answered on 22 Jan 2013
11 answers
525 views
Using:  WPF 4.0, latest trial build of WPF controls

I'm using the RadTabControl with Prism and cannot get Region.Activate to work.  I successfully load multiple views into a RadTabControl that is defined as a Prism Region but when I want to activate one of the views already loaded as below the tab does not get selected as the new active tab.

 

Private Sub ShowChildScreen(ByVal param As ScreenActivateEventArgs)
If Not 
_screenregistry.ContainsKey(param.ScreenId) Then
    
Throw New 
InvalidOperationException(String.Format("ScreenId {0} not registered."param.ScreenId))
End If
Dim s As IScreen = 
_container.TryResolve(_screenregistry.Item(param.ScreenId))
s.ScreenSubject = 
param.ScreenSubject
Dim reg As IRegion = 
_regionManager.Regions(param.RegionName)
Dim v As Object
reg.GetView(s.ScreenKey)
If v Is Nothing Then
    reg.Add(s.View, 
s.ScreenKey)
Else
 reg.Activate(v)
End 
If
End Sub

 

 

 

 
My tab control XAML is as follows:

 

<telerik:RadTabControl cal:RegionManager.RegionName="MainWorkspaceRegion" 
Grid.Row="1" DropDownDisplayMode="Visible"
<telerik:RadTabControl.ItemContainerStyle>
<Style 
TargetType="{x:Type telerik:RadTabItem}"><Setter Property="Header" 
Value="{Binding DataContext}" /><Setter Property="HeaderTemplate"
<Setter.Value><DataTemplate><Grid
<Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/> 
<ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions
<TextBlock Grid.Column="0" Text="{Binding DisplayName}"/> 
<Button Command="{Binding CloseCommand}" Grid.Column="1" Content="X" 
Cursor="Hand" Focusable="False" FontFamily="Courier" 
FontSize="9" FontWeight="Bold" Margin="4,1,0,0" Padding="0" 
VerticalContentAlignment="Bottom" Width="16" Height="16" /> 
</Grid></DataTemplate> </Setter.Value
</Setter><Setter Property="Height" Value="25" /> 
<Setter Property="IsSelected" Value="True" />
</Style></telerik:RadTabControl.ItemContainerStyle
</telerik:RadTabControl>

 

 

 

 

 

Daniel
Top achievements
Rank 1
 answered on 22 Jan 2013
3 answers
324 views
Dear Telerik,

I have a license for both DevExpress and Telerik (license check required?). Currently, I would like to port a DevExpress DataGrid (WinForm) to Telerik RadGridView (WPF). The .NET framework I am using is 3.5 and I am not allowed to upgrade it to 4.5, unfortunately, so I am stuck with an older version of Telerik.

Since I am still in the process of working up a solution, the list of problems I have may change (increase) over time, but so far these are the two main issues I've encountered so far:

1. Row selection

I cannot get RadGridView to return the row indices of the selected rows. It appears later version has a SelectedRows property but my version only has SelectedCells and SelectedItems. The cell info objects, interestingly, only has information on column and not row.

2. Multithreading

The DevExpress DataGrid I am porting appears to have code that involve multithreading handling. I did a brief Google search and the way to port things like "InvokeRequired" did not seem immediately obvious. Is there like a FAQ for this topic?

Thanks for now.
New
Top achievements
Rank 1
 answered on 22 Jan 2013
2 answers
279 views
Hi, 


I'm using the gridview to show items that are defined like following code:

public class GridLine
    {
        public string Key { get; set; }
        public List<Year> Years { get; set; }
    }
 
public class Year
    {
        public string Code { get; set; }
        public int TotalValue { get { return Months != null ? Months.Sum(m => m.Value) : 0; } }
        public List<Month> Months { get; set; }
    }
 
public class Month
    {
        public string Code { get; set; }
        public int Value { get; set; }
    }

Because the list of years and the list of months are hierarchically and have variable lengths, the columns for these items must be generated on data load of the datagrid. The bindings are also defined in this part.

The desired behavior of the year column and the corresponding month columns is like this:
  • when the year column is visible, the month columns aren't visible
  • when doubleclicked on the header of the year column, the month columns are shown and the year column is hidden. 
  • vice versa...

I'm using this code to obtain this:

private void TestGridDataLoaded(object sender, EventArgs e)
{
    var items = (List<GridLine>)TestGrid.ItemsSource;
    if (items == null || items.Count == 0) return;
 
 
    // Generate columns for hierarchical years and months.
    for (int yearCounter = 0; yearCounter < FixedNumberOfYears; yearCounter++)
    {
        var year = items[0].Years[yearCounter];
        var yearColumn = new GridViewDataColumn
            {
                Tag = year.Code,
                DataMemberBinding = new Binding(string.Format("Years[{0}].TotalValue", yearCounter)),
            };
        yearColumn.Header = CreateColumnHeaderLabel(yearColumn, year.Code);    // creates a double clickable header to toggle visibility
 
        _gridColumns.Add(yearColumn, new List<GridViewDataColumn>());
        TestGrid.Columns.Add(yearColumn);
 
        for (var monthCounter = 0; monthCounter < FixedNumberOfMonths; monthCounter++)
        {
            var month = year.Months[monthCounter];
            var monthColumn = new GridViewDataColumn
            {
                IsVisible = false,
                Header = CreateColumnHeaderLabel(yearColumn, month.Code, true),
                DataMemberBinding = new Binding(string.Format("Years[{0}].Months[{1}].Value", yearCounter, monthCounter))
            };
 
            _gridColumns[yearColumn].Add(monthColumn);
            TestGrid.Columns.Add(monthColumn);
        }
    }
}
 
private System.Windows.Controls.Label CreateColumnHeaderLabel(GridViewDataColumn yearColumn, string content, bool isMonth = false)
{
    var label = new System.Windows.Controls.Label
    {
        Content = content,
        Tag = yearColumn, Foreground = new SolidColorBrush( isMonth ? Colors.Yellow : Colors.White)
    };
 
    label.MouseDoubleClick += ToggleColumnsVisibility;
 
    return label;
}


Now, all this works fine, except for the showing and hiding of the columns. The performance of this action is quite slow. when a dozen columns must be hidden (IsVisible=false) and a dozen hidden columns must be shown (IsVisible=true), it takes some seconds. 

Can anyone explain to me how this showing and hiding using the  IsVisible property works and if there are ways to reduce the rendering time of these actions?

I've added a screenshot of the real life project to this thread. The project is much more complex then the code samples above because it uses converters, custom celltemplates, custom celledittemplates... when creating the columns for month and year. This probably also slows down the rendering.

Best regards, 
Pieter Jan Verfaillie
Pieter Jan Verfaillie
Top achievements
Rank 1
 answered on 22 Jan 2013
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?