Hi support!
I would like to know how to configure a RadTreeListView line if user click in a hyperlink inside cell and this line is bold... but I would like to set to normal fornt all line , for example:
Thanks!
--------------------------------MainPage.xaml-----------------------
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SilverlightApplication1"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Height="213" Width="469" xmlns:my="clr-namespace:Telerik.Windows.Controls.TreeView;assembly=Telerik.Windows.Controls.Navigation">
<UserControl.Resources>
<telerik:CellTemplate x:Key="firstNameTemplate" >
<HyperlinkButton Content="{Binding FirstName}" Foreground="Black" IsTabStop="False" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,3,0,3" Click="Cell_Click"/>
</telerik:CellTemplate>
<telerik:CellTemplate x:Key="lastNameTemplate">
<HyperlinkButton Content="{Binding LastName}" Foreground="Black" IsTabStop="False" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,3,0,3" Click="Cell_Click"/>
</telerik:CellTemplate>
<DataTemplate x:Key="itemTemplate">
<Grid />
</DataTemplate>
</UserControl.Resources>
<nav:RadTreeListView Background="White" x:Name="RadTreeListViewTest" BorderBrush="#a9a9a9" BorderThickness="1" HorizontalContentAlignment="Center" Width="415" Height="170" SelectionMode="Single"
ItemTemplate="{StaticResource itemTemplate}"
IsSingleExpandPath="False"
IsExpandOnSingleClickEnabled="True"
IsLineEnabled="True" IsEditable="True">
<nav:RadTreeListView.Columns>
<nav:RadColumn Header="First Name" PropertyName="FirstName" Width="150" IsEditable="True" Foreground="Black" CellTemplate="{StaticResource firstNameTemplate}" />
<nav:RadColumn Header="Last Name" PropertyName="LastName" Width="150" IsEditable="True" Foreground="Black" CellTemplate="{StaticResource lastNameTemplate}"/>
</nav:RadTreeListView.Columns>
</nav:RadTreeListView>
</UserControl>
--------------------------------MainPage.xaml.cs-----------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.ObjectModel;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
//Add only Folders, after click add parents...
IList itemsSource = new ObservableCollection<object>();
itemsSource = new NameList();
this.RadTreeListViewTest.ItemsSource = itemsSource;
}
private void Cell_Click(object sender, RoutedEventArgs e)
{
object m_control = sender;
Type m_control_type = m_control.GetType();
if (m_control_type.Name == "HyperlinkButton")
{
//Set to normal Font
((HyperlinkButton)sender).FontWeight = FontWeights.Normal;
}
}
}
}
------------------NamedList.cs class-----------------------
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
public class NameList : ObservableCollection<PersonName>
{
public NameList()
: base()
{
Add(new PersonName("XX", "11"));
Add(new PersonName("WW", "22"));
Add(new PersonName("AA", "33"));
Add(new PersonName("QQ", "44"));
Add(new PersonName("RR", "55"));
}
}
public class PersonName
{
private string firstName;
private string lastName;
public PersonName(string first, string last)
{
this.firstName = first;
this.lastName = last;
}
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
}
I would like to know how to configure a RadTreeListView line if user click in a hyperlink inside cell and this line is bold... but I would like to set to normal fornt all line , for example:
Thanks!
--------------------------------MainPage.xaml-----------------------
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SilverlightApplication1"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Height="213" Width="469" xmlns:my="clr-namespace:Telerik.Windows.Controls.TreeView;assembly=Telerik.Windows.Controls.Navigation">
<UserControl.Resources>
<telerik:CellTemplate x:Key="firstNameTemplate" >
<HyperlinkButton Content="{Binding FirstName}" Foreground="Black" IsTabStop="False" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,3,0,3" Click="Cell_Click"/>
</telerik:CellTemplate>
<telerik:CellTemplate x:Key="lastNameTemplate">
<HyperlinkButton Content="{Binding LastName}" Foreground="Black" IsTabStop="False" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,3,0,3" Click="Cell_Click"/>
</telerik:CellTemplate>
<DataTemplate x:Key="itemTemplate">
<Grid />
</DataTemplate>
</UserControl.Resources>
<nav:RadTreeListView Background="White" x:Name="RadTreeListViewTest" BorderBrush="#a9a9a9" BorderThickness="1" HorizontalContentAlignment="Center" Width="415" Height="170" SelectionMode="Single"
ItemTemplate="{StaticResource itemTemplate}"
IsSingleExpandPath="False"
IsExpandOnSingleClickEnabled="True"
IsLineEnabled="True" IsEditable="True">
<nav:RadTreeListView.Columns>
<nav:RadColumn Header="First Name" PropertyName="FirstName" Width="150" IsEditable="True" Foreground="Black" CellTemplate="{StaticResource firstNameTemplate}" />
<nav:RadColumn Header="Last Name" PropertyName="LastName" Width="150" IsEditable="True" Foreground="Black" CellTemplate="{StaticResource lastNameTemplate}"/>
</nav:RadTreeListView.Columns>
</nav:RadTreeListView>
</UserControl>
--------------------------------MainPage.xaml.cs-----------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.ObjectModel;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
//Add only Folders, after click add parents...
IList itemsSource = new ObservableCollection<object>();
itemsSource = new NameList();
this.RadTreeListViewTest.ItemsSource = itemsSource;
}
private void Cell_Click(object sender, RoutedEventArgs e)
{
object m_control = sender;
Type m_control_type = m_control.GetType();
if (m_control_type.Name == "HyperlinkButton")
{
//Set to normal Font
((HyperlinkButton)sender).FontWeight = FontWeights.Normal;
}
}
}
}
------------------NamedList.cs class-----------------------
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
public class NameList : ObservableCollection<PersonName>
{
public NameList()
: base()
{
Add(new PersonName("XX", "11"));
Add(new PersonName("WW", "22"));
Add(new PersonName("AA", "33"));
Add(new PersonName("QQ", "44"));
Add(new PersonName("RR", "55"));
}
}
public class PersonName
{
private string firstName;
private string lastName;
public PersonName(string first, string last)
{
this.firstName = first;
this.lastName = last;
}
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
}