hello,
i am new to the telerik controls and i have a question to the radtreeview.
I have two normal classes and a hierarichal template. Everything works fine and the data is shown in tree.
Instead of the normal class i want to use the radtreeviewitem. I try to inherit wich works for the nodes but
not for the childs. Can you please give me a advice how to do this. Here is my code and my problem is
the Children property in the class recursiveObject. Thank you and greetings ....
public static ObservableCollection<
RecursiveObject
> FillRecursive(List<
FlatObject
> flatObjects, int parentId)
{
ObservableCollection<
RecursiveObject
> recursiveObjects = new ObservableCollection<
RecursiveObject
>();
foreach (var item in flatObjects.Where(x => x.ParentId.Equals(parentId)))
{
recursiveObjects.Add(new RecursiveObject
{
Data = item.Data,
NodeId = item.Id,
Menge = item.Menge,
Selected = false,
ParentKey = item.ParentId,
Children = FillRecursive(flatObjects, item.Id)
});
}
return recursiveObjects;
}
public class FlatObject
{
public int Id { get; set; }
public int ParentId { get; set; }
public string Data { get; set; }
public int Menge { get; set; }
public FlatObject(string name, int id, int parentId, int menge)
{
Data = name;
Id = id;
ParentId = parentId;
Menge = menge;
}
}
public class RecursiveObject : RadTreeViewItem
{
public bool Selected { get; set; }
public int NodeId { get; set; }
public int ParentKey { get; set; }
public string Data { get; set; }
public int Menge { get; set; }
public ObservableCollection<
RecursiveObject
> Children { get; set; }
}
Hi, Is there a way to change the ResourceType orientation to vertical, but mantaining the days in horizontal?
We want to make something like in the attached file.
Greetings.
Hi,
I have a relatively simple RadGridView with a datapager. On one machine everything works fine. However, when I check out the sources to another machine everything works, but the datapager does not display, and there is no indication of an error. Any ideas how I could track this down?
Thanks ... Ed
Hi ,
i using MVVM and the problem i have is i capture RowValidating Event which is routedto a Method OnValidatingRow(arg)
DoValidatingRow = new DelegateCommand<object>(OnValidatingRow);
there i checkif valid or not and setting in some cases evnt.IsValid = false;
public override void OnValidatingRow(object arg)
{
var evnt = (GridViewRowValidatingEventArgs)arg;
evnt.IsValid = false;
<telerik:RadGridView x:Name="LookupListGridCtrl" ItemsSource="{Binding Nodes, Mode=TwoWay}" SelectedItem="{Binding Nodes.SelectedUiDataItem,Mode=TwoWay}" Grid.Row="1"
AutoGenerateColumns="false" GroupRenderMode="Flat" NewRowPosition="Top" SelectionMode="Single" SelectionUnit="FullRow"
CanUserDeleteRows="True" ScrollMode="Deferred" IsSynchronizedWithCurrentItem="True" CanUserResizeColumns="True" CanUserSearch="True"
RowIndicatorVisibility="Visible" Margin="0,0,0,1" ValidationType="Default">
<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding CommandProvider.DoDeleteRow}" EventName="Deleted" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoInsertRow}" EventName="RowEditEnded" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoAddNew}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoValidatingCell}" EventName="CellValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoValidatingRow}" EventName="RowValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
</telerik:EventToCommandBehavior.EventBindings>
Hi,
Sorry if my question has been asked already in this forum.
I'm using a RadMaskedTextInput with a dynamic MASK set in code behind. My current mask is d4Sd3. Therefore, I am expecting 4 digits followed with a capital S and then another 3 digits.
It works well except that in my code behind I would like to get the full content of the input. If I type in 1234567 it displays 1234S567 which is perfect, but then in my code behind I only get 1234567 and the "S" is gone. I need this S to remain in this string. How can I achieve such thing ? This is just an example, it could be any sort of mask.
Cheers,
Chris
I'm starting to play around with the Telerik RTB and I was wondering if there was a way to get the word under the mouse cursor?
Hello,
I'm binding to multiple items using PropertySetMode="Intersection" and CurrentPropertySet. Changes to the properties from the PropertyGrid combobox work as expected, but changes to the objects from anywhere else in the application do not cause the PropertyGrid to update until the item selection is refreshed. The objects implement INotifyPropertyChanged. Is there something else I'm missing to get the changes to be shown in the PropertyGrid?
Here is some of the relevant XAML and my view model:
<
DataTemplate
x:Key
=
"TemplateComboBoxTemplate"
>
<
telerik:RadComboBox
ItemsSource
=
"{Binding Clubs, Source={StaticResource MyViewModel}}"
SelectedValue
=
"{Binding CurrentPropertySet[ClubID], Mode=TwoWay}"
SelectedValuePath
=
"ID"
DisplayMemberPath
=
"Name"
Margin
=
"0"
>
</
telerik:RadComboBox
>
</
DataTemplate
>
<
telerik:RadPropertyGrid
Item
=
"{Binding Players}"
PropertySetMode
=
"Intersection"
AutoGeneratePropertyDefinitions
=
"True"
AutoGeneratingPropertyDefinition
=
"RadPropertyGrid_AutoGeneratingPropertyDefinition"
/>
public
class
MyViewModel : INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler PropertyChanged;
private
ObservableCollection<Club> clubs;
private
ObservableCollection<Player> players;
private
List<Player> playersTemp =
new
List<Player>();
public
MyViewModel()
{
clubs =
new
ObservableCollection<Club>();
Club club;
// Liverpool
club =
new
Club(
"Liverpool"
,
new
DateTime(1892, 1, 1), 45362, 1);
club.Players.Add(
new
Player(
"Pepe Reina"
, 25, Position.GK,
"Spain"
, 1,
true
));
clubs.Add(club);
// Manchester Utd.
club =
new
Club(
"Manchester Utd."
,
new
DateTime(1878, 1, 1), 76212, 2);
club.Players.Add(
new
Player(
"Edwin van der Sar"
, 1, Position.GK,
"Netherlands"
, 2,
false
));
clubs.Add(club);
// Chelsea
club =
new
Club(
"Chelsea"
,
new
DateTime(1905, 1, 1), 42055, 3);
club.Players.Add(
new
Player(
"Petr ÄŒech"
, 1, Position.GK,
"Czech Republic"
, 3,
true
));
clubs.Add(club);
// Arsenal
club =
new
Club(
"Arsenal"
,
new
DateTime(1886, 1, 1), 60355, 4);
club.Players.Add(
new
Player(
"Manuel Almunia"
, 1, Position.GK,
"Spain"
, 4,
false
));
clubs.Add(club);
players =
new
ObservableCollection<Player>(clubs.SelectMany(c => c.Players));
}
public
ObservableCollection<Club> Clubs
{
get
{
return
this
.clubs;
}
}
public
ObservableCollection<Player> Players
{
get
{
return
this
.players;
}
}
internal
void
ClearPlayers()
{
playersTemp.AddRange(players);
players.Clear();
OnPropertyChanged(nameof(Players));
}
internal
void
SelectPlayers()
{
foreach
(var player
in
playersTemp)
{
players.Add(player);
}
playersTemp.Clear();
OnPropertyChanged(nameof(Players));
}
protected
virtual
void
OnPropertyChanged(PropertyChangedEventArgs args)
{
PropertyChangedEventHandler handler =
this
.PropertyChanged;
if
(handler !=
null
)
{
handler(
this
, args);
}
}
private
void
OnPropertyChanged(
string
propertyName)
{
this
.OnPropertyChanged(
new
PropertyChangedEventArgs(propertyName));
}
}
I prepared a sample project starting from another sample I found on this forum but I was unable to upload. I can provide this if it helps.
Thanks for any help you can offer!
Can diagram be painted on intitialization based on input data ?
if i have list of objects and then for each object will be created shape
thank you
Hi,
I am using WPF , MEF, PRISM and Telerik Components RadGrid , RadDataFilter and RadDataPager with the StyleManager.
The Problem i have is in RadDataFilter .If i open the Filter Criterias the Value for Filter is missing in Fluent Dark and Light . But if i only switch the Theme to Win8 it´s there. The Code of my View is below and some Pictures of the visual Tree are in the Attachments.
Is this a Bug in Fluent Styles or mine in xaml ?
In App.xaml.cs i only switch this 2 block of code to see if there is a Field in Win8 and also in Fluent but i can only find it in Win8 Theme correctly.
//Fluent resources
FluentPalette.LoadPreset(FluentPalette.ColorVariation.Light);
FluentPalette.Palette.FontSizeS = 10;
FluentPalette.Palette.FontSize = 10;
FluentPalette.Palette.FontSizeL = 12;
FluentPalette.Palette.FontSizeXL = 14;
FluentPalette.Palette.FontFamily = new FontFamily("Segoe UI");
FluentPalette.Palette.CornerRadius = new CornerRadius(5);
FluentTheme apptheme = new FluentTheme();
ThemeEffectsHelper.IsAcrylicEnabled = false;
StyleManager.ApplicationTheme = apptheme;
//Windows8Touch resources
//Windows8Palette.Palette.FontSizeS = 8;
//Windows8Palette.Palette.FontSize = 10;
//Windows8Palette.Palette.FontSizeL = 12;
//Windows8Palette.Palette.FontSizeXL = 14;
//Windows8Palette.Palette.FontSizeXXL = 16;
//Windows8Palette.Palette.FontFamily = new FontFamily("Courier New");
//Windows8Palette.Palette.FontFamilyLight = new FontFamily("Courier New");
//Windows8Palette.Palette.FontFamilyStrong = new FontFamily("Courier New");
//StyleManager.ApplicationTheme = new Windows8Theme();
If you look into the visual Tree attached pictures it looks like there is something missing under the "Filter Editor" in Fluent Style compared to the same entry in Win8.
I also tried this Styles with different results.
worked ok with Vista => value field is there with StyleManager.ApplicationTheme = new VistaTheme();
but it´s also missing with => StyleManager.ApplicationTheme = new MaterialTheme();
Any Idea how i can fix this please.
Thanks br
Thomas Cinatl
<UserControl x:Class="MySolutionApplication.Views.LookupListGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:Mvvm="clr-namespace:Prism.Mvvm;assembly=Prism.Wpf"
UseLayoutRounding="True" IsEnabled="True"
Mvvm:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d" d:DesignWidth="1022" d:DesignHeight="649"
>
<DockPanel>
<DockPanel.Resources>
<Style x:Key="CenterCheckBoxColumnCellStyle" TargetType="telerik:GridViewCell">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
<Style x:Key="GridViewHeaderRowStyle" TargetType="{x:Type telerik:GridViewHeaderCell}">
<Setter Property="Background"
Value="DarkBlue" />
</Style>
</DockPanel.Resources>
<TextBlock x:Name="label" Text="{Binding DisplayName,FallbackValue='Lookup'}" Grid.Row="0" Margin="0" HorizontalAlignment="Stretch" Style="{StaticResource HeaderStyle}" VerticalAlignment="Center"
DockPanel.Dock="Top"/>
<telerik:RadExpander DockPanel.Dock="Top" Header="SEARCH" FontWeight="Bold">
<telerik:RadDataFilter x:Name="radDataFilter" Source="{Binding Items, ElementName=LookupListGridCtrl}" >
</telerik:RadDataFilter>
</telerik:RadExpander>
<telerik:RadGridView x:Name="LookupListGridCtrl" ItemsSource="{Binding Nodes,Mode=TwoWay}" SelectedItem="{Binding Nodes.SelectedUiDataItem,Mode=TwoWay}" Grid.Row="1"
AutoGenerateColumns="false" GroupRenderMode="Flat" NewRowPosition="Top"
CanUserDeleteRows="True" ScrollMode="Deferred" IsSynchronizedWithCurrentItem="True" CanUserResizeColumns="True"
RowIndicatorVisibility="Visible" Margin="0,0,0,1"
IsFilteringAllowed="False">
<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding CommandProvider.DoDeleteRow}" EventName="Deleted" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoInsertRow}" EventName="RowEditEnded" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoAddNew}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoValidatingCell}" EventName="CellValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding CommandProvider.DoValidatingRow}" EventName="RowValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
</telerik:EventToCommandBehavior.EventBindings>
<telerik:RadGridView.Columns>
<telerik:GridViewColumn Header="x" Width="30" HeaderTextAlignment="Center" HeaderCellStyle="{DynamicResource GridViewHeaderRowStyle}" IsFilterable="False"
IsGroupable="False" IsReorderable="False" IsSortable="False" IsResizable="False">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Command="telerikGrid:RadGridViewCommands.Delete"
CommandParameter="{Binding}"
telerik:TouchManager.IsTouchHitTestVisible="False">
<Image Height="15" Width="15" Source="/MySolutionApplication;component/Images/DeleteHS.png"/>
</telerik:RadButton>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Text: lookup_lkp -->
<telerik:GridViewDataColumn Header="LOOKUP"
DataMemberBinding="{Binding lookup_lkp, Mode=TwoWay}"
Width="90*"
TextAlignment="Left"/>
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Compared with : group_lookup_lkp IN :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Lookup: group_lookup_lkp -->
<telerik:GridViewComboBoxColumn Header="GROUP LOOKUP" Width="180*"
DataMemberBinding="{Binding group_lookup_lkp, Mode=TwoWay}"
DisplayMemberPath="display_nam"
ItemsSource="{Binding Nodes.GroupLookups}"
SelectedValueMemberPath="lookup_lkp"
>
<telerik:GridViewComboBoxColumn.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding display_nam}" TextAlignment="Left"/>
</Grid>
</DataTemplate>
</telerik:GridViewComboBoxColumn.ItemTemplate>
</telerik:GridViewComboBoxColumn>
<!-- Ignore NonList: alias_id -->
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Compared with : par_lkp_lookup_lkp IN :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Lookup: par_lkp_lookup_lkp -->
<telerik:GridViewComboBoxColumn Header="PAR LKP LOOKUP" Width="210*"
DataMemberBinding="{Binding par_lkp_lookup_lkp, Mode=TwoWay}"
DisplayMemberPath="display_nam"
ItemsSource="{Binding Nodes.ParLkpLookups}"
SelectedValueMemberPath="lookup_lkp"
>
<telerik:GridViewComboBoxColumn.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding display_nam}" TextAlignment="Left"/>
</Grid>
</DataTemplate>
</telerik:GridViewComboBoxColumn.ItemTemplate>
</telerik:GridViewComboBoxColumn>
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Compared with : par_lkp_group_lookup_lkp IN :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Lookup: par_lkp_group_lookup_lkp -->
<telerik:GridViewComboBoxColumn Header="PAR LKP GROUP LOOKUP" Width="300*"
DataMemberBinding="{Binding par_lkp_group_lookup_lkp, Mode=TwoWay}"
DisplayMemberPath="display_nam"
ItemsSource="{Binding Nodes.ParLkpGroupLookups}"
SelectedValueMemberPath="lookup_lkp"
>
<telerik:GridViewComboBoxColumn.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding display_nam}" TextAlignment="Left"/>
</Grid>
</DataTemplate>
</telerik:GridViewComboBoxColumn.ItemTemplate>
</telerik:GridViewComboBoxColumn>
<!-- Ignore NonList: external_uri -->
<!-- Ignore NonList: customized_flg -->
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Text: display_nam -->
<telerik:GridViewDataColumn Header="DISPLAY"
DataMemberBinding="{Binding display_nam, Mode=TwoWay}"
Width="120*"
TextAlignment="Left"/>
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Text: display_short_txt -->
<telerik:GridViewDataColumn Header="DISPLAY SHORT"
DataMemberBinding="{Binding display_short_txt, Mode=TwoWay}"
Width="195*"
TextAlignment="Left"/>
<!-- Ignore NonList: report_txt -->
<!-- Ignore NonList: description_txt -->
<!-- Ignore Audit: create_user -->
<!-- Ignore Audit: create_date -->
<!-- Ignore Audit: modify_user -->
<!-- Ignore Audit: modify_date -->
<!-- Ignore Audit: valid_from -->
<!-- Ignore Audit: valid_to -->
<!-- Ignore Audit: deleted_yn -->
<!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
<!-- Flag: valid_yn -->
<telerik:GridViewCheckBoxColumn Header="VALID" DataMemberBinding="{Binding IsValidYn, Mode=TwoWay}" AutoSelectOnEdit="True" EditTriggers="CellClick" Width="75*" >
<telerik:GridViewCheckBoxColumn.CellStyle>
<Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource CenterCheckBoxColumnCellStyle}">
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
</telerik:GridViewCheckBoxColumn.CellStyle>
</telerik:GridViewCheckBoxColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadDataPager PageSize="20"
Grid.Row="2" FontSize="12" Margin="0,-1,0,0"
Source="{Binding Items, ElementName=LookupListGridCtrl}"
IsTotalItemCountFixed="True"
DisplayMode="FirstLastPreviousNextNumeric, Text" />
<!--</Grid>-->
</DockPanel>
</UserControl>