<
telerik:RadTreeView
telerik:AnimationManager.IsAnimationEnabled
=
"False"
Grid.Row
=
"0"
ItemsSource
=
"{Binding ElementName=ElementRoot, Path=RoleList}"
SelectedItem
=
"{Binding ElementName=ElementRoot, Path=SelectedRole, Mode=TwoWay}"
ItemContainerStyle
=
"{StaticResource ApplicationTreeViewStyle}"
IsOptionElementsEnabled
=
"True"
ItemsOptionListType
=
"CheckList"
IsTriStateMode
=
"True"
DropExpandDelay
=
"00:00:00"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
/>
<
HierarchicalDataTemplate
DataType
=
"{x:Type Models:Role}"
ItemsSource
=
"{Binding Children}"
>
<
TextBlock
Text
=
"{Binding DisplayName}"
/>
</
HierarchicalDataTemplate
>
<
Style
x:Key
=
"ApplicationTreeViewStyle"
TargetType
=
"{x:Type telerik:RadTreeViewItem}"
>
<
Setter
Property
=
"IsSelected"
Value
=
"{Binding Path=Selected, Mode=TwoWay}"
/>
<
Setter
Property
=
"CheckState"
Value
=
"{Binding Path=Checked, Mode=TwoWay, Converter={StaticResource Bool2ToggleConverter}}"
/>
<
Setter
Property
=
"IsExpanded"
Value
=
"{Binding Path=Expanded, Mode=TwoWay}"
/>
</
Style
>
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 Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Data;
namespace RadControlsWpfApp6
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
AllPersons = new List<Person>();
AllPersons.Add(new Person() { LastName = "Test2", FirstName = "Test1" });
AllPersons.Add(new Person() { LastName = "Test1", FirstName = "Test2" });
AllPersons.Add(new Person() { LastName = "Test2", FirstName = "Test1" });
grid.ItemsSource = AllPersons;
}
public List<Person> AllPersons { get; set; }
private void grid_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
var senderElement = (FrameworkElement)e.OriginalSource;
var clickedCell = senderElement.ParentOfType<GridViewHeaderCell>();
if (clickedCell != null)
{
CheckBox chkHeader = clickedCell.Column.Header as CheckBox;
if (chkHeader != null)
{
IEnumerable<GridViewGroupRow> grpRows = grid.ChildrenOfType<GridViewGroupRow>();
GridViewGroupCheckBox.CheckUncheckItems(true, !(bool)chkHeader.IsChecked, grpRows);
}
}
}
private void grid_SelectionChanged(object sender, SelectionChangeEventArgs e)
{
GridViewItemContainerGenerator container = this.grid.ItemContainerGenerator;
foreach (var oneItem in e.AddedItems)
{
object obj = container.ContainerFromItem(oneItem);
}
foreach (var oneItem in e.RemovedItems)
{
}
}
}
public class Person
{
public string LastName { get; set; }
public string FirstName { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Data;
namespace RadControlsWpfApp6
{
/// <summary>
/// Interaction logic for GridViewGroupCheckBox.xaml
/// </summary>
public partial class GridViewGroupCheckBox : UserControl
{
#region Constructors.
/// <summary>
/// Costructor.
/// </summary>
public GridViewGroupCheckBox()
{
InitializeComponent();
mIsChecked = false;
}
#endregion
#region Public properties.
public bool IsChecked
{
get
{
return mIsChecked;
}
set
{
if (mIsChecked != value)
{
mIsChecked = value;
cbGroup.IsChecked = mIsChecked;
}
}
}
public GridViewGroupRow GroupRow
{
get
{
return cbGroup.ParentOfType<GridViewGroupRow>();
}
}
#endregion.
#region Private event handlers.
/// <summary>
/// CheckBox click triggered.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void cbGroup_Click(object sender, RoutedEventArgs e)
{
mIsChecked = (bool)(sender as CheckBox).IsChecked;
applyChangesOnGrid(sender as CheckBox);
}
#endregion
#region Private medthods.
/// <summary>
/// Apply changes
/// </summary>
/// <param name="pCheckBox"></param>
private void applyChangesOnGrid(CheckBox pCheckBox)
{
CheckUncheckItems(false, (bool)pCheckBox.IsChecked, this.GroupRow);
IEnumerable<GridViewGroupRow> groupsChildRows = this.GroupRow.ChildrenOfType<GridViewGroupRow>();
CheckUncheckItems(false, (bool)pCheckBox.IsChecked, groupsChildRows);
}
/// <summary>
/// Select/unselect all items in a group.
/// </summary>
/// <param name="pCheck">TRUE to select or FALSE to unselect.</param>
/// <param name="pGroupRows">Group of rows.</param>
static public void CheckUncheckItems(bool pIsInAllSelectionMode, bool pCheck, GridViewGroupRow pGroupRows)
{
if (!pIsInAllSelectionMode)
{
var theGrid = pGroupRows.ParentOfType<GridViewDataControl>();
IEnumerable<CheckBox> allCheckBox = pGroupRows.ChildrenOfType<CheckBox>();
if (allCheckBox != null)
{
foreach (CheckBox oneCheckBox in allCheckBox)
{
oneCheckBox.IsChecked = pCheck;
}
}
if (theGrid != null)
{
foreach (var item in pGroupRows.Items)
{
if (pCheck)
{
theGrid.SelectedItems.Add(item);
}
else
{
theGrid.SelectedItems.Remove(item);
}
}
}
}
}
/// <summary>
/// For each sub group rows, select/unselect all items in a group.
/// </summary>
/// <param name="pCheck">TRUE to select or FALSE to unselect.</param>
/// <param name="pGroupsRows">List of groups rows.</param>
static public void CheckUncheckItems(bool pIsInAllSelectionMode, bool pCheck, IEnumerable<GridViewGroupRow> pGroupsRows)
{
foreach (GridViewGroupRow oneGroupRow in pGroupsRows)
{
CheckUncheckItems(pIsInAllSelectionMode, pCheck, oneGroupRow);
}
}
#endregion
#region Private declarations.
private bool mIsChecked;
#endregion
}
}
Hello,
I have a problem with the title of the views. In my case I have 5 views:
1 - dayview
2 - WeekView
3 - WorkWeekView
4 - MonthView
5 - TimeLineView
I noticed that when I switch to workWeekView, I get the title of dayview.
I could tell how to fix this?
Thanks!
StyleManager.ApplicationTheme =
new
MetroTheme();
<
telerik:RadTileView
MaximizeMode
=
"ZeroOrOne"
RowHeight
=
"200"
ColumnWidth
=
"250"
>
<
telerik:RadTileViewItem
Header
=
"Berkeley Park"
>
<
TextBlock
>Test</
TextBlock
>
</
telerik:RadTileViewItem
>
<
telerik:RadTileViewItem
Header
=
"Posh Park Developments"
>
<
TextBlock
Margin
=
"10"
>Test</
TextBlock
>
</
telerik:RadTileViewItem
>
<
telerik:RadTileViewItem
Header
=
"King Park"
>
<
TextBlock
Margin
=
"10"
>Test</
TextBlock
>
</
telerik:RadTileViewItem
>
<
telerik:RadTileViewItem
Header
=
"King Park"
>
<
TextBlock
Margin
=
"10"
>Test</
TextBlock
>
</
telerik:RadTileViewItem
>
<
telerik:RadTileViewItem
Header
=
"King Park"
>
<
TextBlock
Margin
=
"10"
>Test</
TextBlock
>
</
telerik:RadTileViewItem
>
</
telerik:RadTileView
>
Hi guys,
how can I use the RadmaskedDateTimeInput scheme inside a Gridview Cell ?
I tried building my GridViewDataColum with
DataFormatString
="{} {0:dd.MM.yyyy}"
but there I have to type the periods, too.
I'd like to have the same behaviour as in the edit field.
I only want to type the numbers, as in:
telerik
:RadMaskedDateTimeInput Mask="dd.MM.yyyy"
best regards
Torsten