Telerik Forums
UI for WPF Forum
1 answer
152 views
Hi,

I am looking to implement a three level hierarchy whereby the child grids are determined on the run time. For example if we select an option from a combo box present on the parent grid, it will create a child grid. Similarly we could repeat the same scenario for the child grid as well. I am looking into doing this by creating hierarchical templates for both the parent and the child:

<telerik:RadGridView x:Name="rgvData" CanUserFreezeColumns="False" GridLinesVisibility="Horizontal" ItemsSource="" IsReadOnly="True" AutoGenerateColumns="False">
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding OrderDate}" Header="Order Date" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding EmployeeID}" Header="Employee" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Freight}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCountry}" Header="Ship Country" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCity}" Header="Ship City" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsReadOnly="True">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerID}" Header="Customer ID" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Address}" Header="Address" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding City}" Header="City" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Country}" Header="Country" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
// The Child will host another template that will define it's own child.

What would be the best way to tackle this scenario. Should I just go by creating the grids through code behind? I would like to stick to xaml. Any pointers would help me decide !

Thanks,
Farhan
Ivan Ivanov
Telerik team
 answered on 14 Mar 2011
3 answers
401 views
Hi,

I need to detect when the ActivePane has changed.  And i also need to know how to get the current active pane.  It is important for my project.

Thank you.
Kais
Top achievements
Rank 1
 answered on 14 Mar 2011
1 answer
150 views
The RadComboBox has a "clear selection button" enabling the user to clear the selection of the combobox. Is it possible to do the same thing with the keyboard or do I have to implement that myself?
Valeri Hristov
Telerik team
 answered on 14 Mar 2011
2 answers
134 views
Hi, 

I just realized that in RadTreeListView, when I do right-click using my  mouse, the clicked row doesn't selected like normal .NET GridView.
So how to make the clicked row selected? 

I would like to use the clicked row as the data for context menu event handler.

Regards, 

Arinto
Arinto
Top achievements
Rank 1
 answered on 14 Mar 2011
2 answers
168 views

Hi all,

 

I am planning to use this gauge, However when I run the example it was not work in my application

Its giving me too much errors

 

Any idea?

The code is below and the picture which I need the same is attached



<demo:DynamicBasePage x:Class="Telerik.Windows.Examples.Gauge.Customization.HalfCircleGauges.Example"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                      xmlns:demo="clr-namespace:Telerik.Examples.Gauge"
                      xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls">
    <demo:DynamicBasePage.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Controls.Gauge;component/Themes/Generic.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </demo:DynamicBasePage.Resources>
    <Grid>
        <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True">
            <telerik:RadGauge x:Name="radGauge">
                <telerik:RadialGauge x:Name="radialGauge"
                                         Style="{StaticResource Office_BlackRadialGaugeHalfCircleNStyle}">
                    <telerik:RadialScale x:Name="radialScale"
                                             Style="{StaticResource Office_BlackRadialScaleHalfCircleNStyle}">
                        <telerik:RadialScale.MajorTick>
                            <telerik:MajorTickProperties />
                        </telerik:RadialScale.MajorTick>
                        <telerik:RadialScale.MiddleTick>
                            <telerik:MiddleTickProperties Length="0.05" TickWidth="0.2" />
                        </telerik:RadialScale.MiddleTick>
                        <telerik:RadialScale.MinorTick>
                            <telerik:MinorTickProperties Length="0.03" TickWidth="0.3" />
                        </telerik:RadialScale.MinorTick>
                        <telerik:IndicatorList>
                            <telerik:Needle x:Name="needle"
                                                IsAnimated="True"
                                                Value="65"/>
                        </telerik:IndicatorList>
                    </telerik:RadialScale>
                </telerik:RadialGauge>
            </telerik:RadGauge>
        </Border>
    </Grid>
  
    <telerikQuickStart:QuickStart.ConfigurationPanel>
        <StackPanel Margin="3">
            <TextBlock>Gauge orientation</TextBlock>
            <telerik:RadComboBox x:Name="gaugeStyle"
                                 SelectionChanged="gaugeStyle_SelectionChanged"
                                 Margin="0,2">
                <telerik:RadComboBoxItem DataContext="HalfCircleN" Content="North"/>
                <telerik:RadComboBoxItem DataContext="HalfCircleS" Content="South"/>
                <telerik:RadComboBoxItem DataContext="HalfCircleE" Content="East"/>
                <telerik:RadComboBoxItem DataContext="HalfCircleW" Content="West"/>
            </telerik:RadComboBox>
        </StackPanel>
    </telerikQuickStart:QuickStart.ConfigurationPanel>
</demo:DynamicBasePage>



Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports Telerik.Windows.Controls
Imports Telerik.Examples.Gauge
  
Namespace Telerik.Windows.Examples.Gauge.Customization.HalfCircleGauges
    ''' <summary>
    ''' Interaction logic for Example.xaml
    ''' </summary>
    Public Partial Class Example
        Inherits DynamicBasePage
        Public Sub New()
            InitializeComponent()
  
            Me.gaugeStyle.SelectedIndex = 0
        End Sub
  
        Protected Overloads Overrides Sub NewValue()
            needle.Value = radialScale.Min + (radialScale.Max - radialScale.Min) * rnd.NextDouble()
        End Sub
  
        Private Sub gaugeStyle_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
            If gaugeStyle IsNot Nothing AndAlso gaugeStyle.SelectedItem IsNot Nothing Then
                Dim styleName As String = DirectCast(TryCast(gaugeStyle.SelectedItem, RadComboBoxItem).DataContext, String)
  
                radGauge.Width = 340
                radGauge.Height = 200
  
                If styleName.EndsWith("E") OrElse styleName.EndsWith("W") Then
                    Dim tmp As Double = radGauge.Width
                    radGauge.Width = radGauge.Height
                    radGauge.Height = tmp
                End If
  
                Dim theme As Theme = StyleManager.GetTheme(radGauge)
                If theme Is Nothing Then
                    theme = StyleManager.ApplicationTheme
                End If
  
                Dim themeName As String = "Office_Black"
                If theme IsNot Nothing Then
                    themeName = theme.ToString()
                End If
  
                Dim gaugeStyleName As String = themeName & "RadialGauge" & styleName & "Style"
                Dim scaleStyleName As String = themeName & "RadialScale" & styleName & "Style"
  
                radialGauge.Style = TryCast(Me.Resources(gaugeStyleName), Style)
                radialScale.Style = TryCast(Me.Resources(scaleStyleName), Style)
            End If
        End Sub
    End Class
End Namespace


Thanks in advance
Anoop
Top achievements
Rank 1
 answered on 13 Mar 2011
3 answers
234 views
Hihi~ is it possible to get a collection of the current visible rows in the RadGridView? I would like to change some of the rows' and cells' visual properties.

Cheers,

Tim.
Maya
Telerik team
 answered on 12 Mar 2011
1 answer
244 views
2010 Q3 SP1
Windows 7

With SelectionMode="Extended", pressing Ctrl+A does not select all items. The documentation claims it should (http://www.telerik.com/help/wpf/gridview-multiple-selection.html). The relevant part of the grid declaration is below.

            <telerik:RadGridView 
                              ScrollViewer.CanContentScroll="True"
                              IsReadOnly="True"
                              ShowGroupPanel="False"
                              SelectionMode="Extended"
                              IsFilteringAllowed="True"
                              RowIndicatorVisibility="Collapsed"
                              CanUserSelect="True"
                              CanUserDeleteRows="False"
                              >
Maya
Telerik team
 answered on 12 Mar 2011
4 answers
67 views
Hi Telerik,

In RadGridView, when dragging a row it defaults with a line indicator of the target position. How can I change this format to a highlighted target row instead while dragging a row? I can't find any tricks to achieve this. Please help! Thanks.
Cheau-Long
Top achievements
Rank 1
 answered on 12 Mar 2011
1 answer
221 views
Hi Telerik Team,
        I had created a style for ToolTip and I applied it for a button. But it is not applying and displays System.Windows.Style as a ToolTip. The following is the ToolTip Style which I created.
 

<

 

 

Style x:Key="ToolTipStyle1" TargetType="{x:Type ToolTip}">

 

    

<Setter Property="Template">

 

    

    <Setter.Value>

 

    

        <ControlTemplate TargetType="{x:Type ToolTip}">

 

    

            <Border Height="Auto" Width="200" BorderThickness="2" BorderBrush="#FFB79700" CornerRadius="3">

 

                    <StackPanel Background="{StaticResource ToolTipBackGround}">

 

    

                    <StackPanel Height="25" Width="200" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{StaticResource ToolTipHeaderBG}">

 

 

                            <Image x:Name="ImgToolTipIcon" VerticalAlignment="Top" Width="30" Height="22" Source="{Binding ToolTipIcon}" />

 

 

                            <TextBlock Foreground="Black" TextWrapping="Wrap" VerticalAlignment="Top" Margin="2,4,4,0" Height="18" Width="Auto" HorizontalAlignment="Right">

 

 

                                <Run x:Name="RunHeaderText" FontFamily="Andalus" FontSize="14" FontWeight="Bold" Text="{Binding ToolTipHeader}"/>

 

 

                            </TextBlock>

 

 

                        </StackPanel>

 

 

                        <StackPanel Width="200" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" > 
                            
<TextBlock TextWrapping="Wrap" Foreground="#FFF9F4F4" TextAlignment="Center" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="181" Height="Auto">

 

 

                                <Run x:Name="RunBodyText" FontFamily="Verdana" FontSize="11" FontWeight="Normal" Foreground="#FF151514" Text="{Binding ToolTipText}"/>

 

                            </TextBlock>

 

                        </StackPanel>

 

                    </StackPanel>

 

                </Border>

 

            </ControlTemplate>

 

         

</Setter.Value>

 

     

</Setter>

 

 

</Style>

 

 

 


I had applied the style in the following code:
 

<

 

 

Button Content="Show Tool Tip" Height="23" Margin="288,226,0,0" Name="Button2" VerticalAlignment="Top" HorizontalAlignment="Left" Width="85" ToolTip="{StaticResource ToolTipStyle1}" />


Please let me know any mistakes available in the Style.

Thanks & Regards
Azharshah H

 

 

 

Petar Mladenov
Telerik team
 answered on 11 Mar 2011
1 answer
192 views
Hi there, 

Is that possible to bind the Visibility property of TreeListView Row into a ViewModel's property?

For example here is the format of the ViewModel
public class EntryViewModel
{
    private String _name;
    private ObservableCollection<EntryViewModel> _items;
    private Boolean _isVisible;
   
    public EntryViewModel(String name, Boolean isVisible = true)
    {
        _name = name;
        _items = new ObservableCollection<TSEntryViewModel>();
        _isVisible = isVisible;
    }
   
    public String Name
    {
        get { return _name;}
        set { _name = value; }
    }
   
    public ObservableCollection<EntryViewModel> Items
    {
        get { return _items; }
        set { _items = value; }
    }
   
    public Boolean IsVisible
    {
        get { return _isVisible; }
        set { _isVisible = value; }
    }
}

So, is that possible to set the Visibility  property of TreeListView row to Collapsed when IsVisible value is false?
I've tried to look for some APIs here but can't find any API that can serve my purpose.
http://www.telerik.com/help/wpf/telerik.windows.controls.gridview-telerik.windows.controls.radtreelistview_members.html


Regards, 

Arinto



Ivan Ivanov
Telerik team
 answered on 11 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?