I have a GridViewDataColumn that binds to a complex model (Custom class with a few properties and a ToString method)
The GridViewDataColumn also has a CustomGridFilter which is able to filter the column and has it's own popup.
But .. now the users also want to Order by this column - but nothing happens when clicking on the Column Header.
What am i missing ?
<telerik:GridViewDataColumn Width="100"
DataMemberBinding="{Binding YearRange}"
Header="Ã…rgang">
<telerik:GridViewDataColumn.FilteringControl>
<local:CustomGridFilter Aargang="{Binding ElementName=root, Path=VintageYear, Mode=TwoWay}" />
</telerik:GridViewDataColumn.FilteringControl>
</telerik:GridViewDataColumn>public class YearRange : IEquatable<int>
{
public int FromYear { get; set; }
public int ToYear { get; set; }
public int Year { get; set; }
public override string ToString()
{
if (FromYear == ToYear)
return FromYear.ToString();
return FromYear + "-" + ToYear;
}
#region Equals, GetHashCode
#region Comparison operators override
}public partial class CustomGridFilter : UserControl, IFilteringControl, INotifyPropertyChanged
{
private GridViewBoundColumnBase column;
private CompositeFilterDescriptor compositeFilter;
private FilterDescriptor rangeFilter;
#region INotifyPropertyChanged
public void OnPropertyChanged(string name) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
public event PropertyChangedEventHandler PropertyChanged;
#endregion
#region IsActive DependencyProperty
public bool IsActive
{
get { return (bool)GetValue(IsActiveProperty); }
set { SetValue(IsActiveProperty, value); }
}
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"IsActive",
typeof(bool),
typeof(CustomGridFilter),
new PropertyMetadata(false));
#endregion
#region Aargang DependencyProperty
public int? Aargang
{
get { return (int?)GetValue(AargangProperty); }
set { SetValue(AargangProperty, value); }
}
public static readonly DependencyProperty AargangProperty =
DependencyProperty.Register(
"Aargang",
typeof(int?),
typeof(CustomGridFilter),
new PropertyMetadata(
null,
(sender, evt) => { ((CustomGridFilter)sender).OnPropertyChanged("Aargang"); }
)
);
#endregion
public CustomGridFilter()
{
InitializeComponent();
DataContext = this;
PropertyChanged += CustomGridFilter_PropertyChanged;
}
private void CustomGridFilter_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "Aargang" && Aargang>1900 && Aargang<2100)
{
OnFilter(null, null);
}
}
public void Prepare(Telerik.Windows.Controls.GridViewColumn column)
{
this.column = column as GridViewBoundColumnBase;
if (this.column == null)
{
return;
}
if (compositeFilter == null)
{
CreateFilters();
}
}
private void CreateFilters()
{
string dataMember = column.DataMemberBinding.Path.Path;
compositeFilter = new CompositeFilterDescriptor();
rangeFilter = new FilterDescriptor(dataMember, FilterOperator.IsEqualTo, null);
compositeFilter.FilterDescriptors.Add(rangeFilter);
}
private void OnFilter(object sender, RoutedEventArgs e)
{
rangeFilter.Value = new YearRange { Year = Aargang ?? 0 };
if (!column.DataControl.FilterDescriptors.Contains(compositeFilter))
{
column.DataControl.FilterDescriptors.Add(compositeFilter);
}
IsActive = true;
var popup = this.ParentOfType<System.Windows.Controls.Primitives.Popup>();
if (popup != null)
{
popup.IsOpen = false;
}
}
private void OnClear(object sender, RoutedEventArgs e)
{
if (column.DataControl.FilterDescriptors.Contains(compositeFilter))
{
column.DataControl.FilterDescriptors.Remove(compositeFilter);
}
Aargang = 0;
IsActive = false;
var popup = this.ParentOfType<System.Windows.Controls.Primitives.Popup>();
if (popup != null)
{
popup.IsOpen = false;
}
}
}
I have a property called FolderName which is bound in storage view.xaml. I set this value with folder dialog. However if I call that value from within storage view or another view.cs its always defaulted. How do I persist the values across the running app. In code base I had to hardcover value.
https://github.com/CrownParkComputing/MegaDownloaderFinal

Hi
I need to represent a list of columns whose number is multiplied for the cardinality of a list of other elements.
For istance I have a list of "Sources": [S1, S2], and for every sources I have a fixed number of values [V1, V2, V3].
The columns table wil be:
S1 | S2
V1 | V2 |V3 | V1 | V2 V3
I achieved that with the following code:
private void SetTableColumns(ObservableCollection<StatisticaTableViewPerClasse> elementi
, IEnumerable<string> sorgentiNames
, string columnClassHeader)
{
GridAnalisiStatisticaTable.Columns.Clear();
GridAnalisiStatisticaTable.ColumnGroups.Clear();
if (elementi.Count() > 0)
{
//var sorgenti = elementi.GroupBy(e => e.Sorgente.Id,
// e => e.Sorgente.Name,
// (id, name) => name).Select(s => s.FirstOrDefault());
foreach (var sorgenteName in sorgentiNames)
{
var groupName = GROUPNAME + sorgenteName;
var group = new GridViewColumnGroup()
{
Header = sorgenteName,
Name = groupName,
};
GridAnalisiStatisticaTable.ColumnGroups.Add(group);
//GridAnalisiStatisticaTable.Columns.Add(new GridViewDataColumn()
//{
// Header = Utility.LoadString(ResourcesKeys.SorgenteColumnHeader),
// DataMemberBinding = new Binding("Sorgente.Name"),
// ColumnGroupName = groupName
//});
GridAnalisiStatisticaTable.Columns.Add(new GridViewDataColumn()
{
Header = columnClassHeader,
DataMemberBinding = new Binding("ClasseHeader"),
ColumnGroupName = groupName
});
GridAnalisiStatisticaTable.Columns.Add(new GridViewDataColumn()
{
Header = Utility.LoadString(ResourcesKeys.DistribuzioneProbabilità Header),
DataMemberBinding = new Binding($"Values[{sorgenteName}].DistribuzioneValue")
{
StringFormat = "N2"
},
ColumnGroupName = groupName
});
GridAnalisiStatisticaTable.Columns.Add(new GridViewDataColumn()
{
Header = Utility.LoadString(ResourcesKeys.Probabilità CumulativaHeader),
DataMemberBinding = new Binding($"Values[{sorgenteName}].CumulativaValue")
{
StringFormat = "N2"
},
ColumnGroupName = groupName
});
}
}
}<t:RadGridView x:Name="GridAnalisiStatisticaTable" Grid.Row="1"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
GroupRenderMode="Flat"
ShowGroupPanel="False"
IsPropertyChangedAggregationEnabled="False"
ItemsSource="{Binding Statistiche}"/>public class StatisticaTableView
{
public StatisticaTableView(KeyValuePair<decimal, double> entry, StatisticType type)
{
switch (type)
{
case StatisticType.DistribuzioneProbabilità :
DistribuzioneValue = entry.Value;
break;
case StatisticType.Probabilità Cumulativa:
CumulativaValue = entry.Value;
break;
case StatisticType.LivelliPercentili:
break;
case StatisticType.DistribuzioneTemporale:
break;
default:
break;
}
}
public double DistribuzioneValue { get; set; }
public double CumulativaValue { get; set; }
}
public class StatisticaTableViewPerClasse
{
public StatisticaTableViewPerClasse(KeyValuePair<decimal, double> entry, decimal classRange, StatisticType type, string sorgenteName)
{
Classe = entry.Key;
ClasseHeader = $"{entry.Key} - {entry.Key + classRange}";
Values.Add(sorgenteName, new(entry, type));
}
public decimal Classe { get; set; }
public string ClasseHeader { get; set; }
public Dictionary<string, StatisticaTableView> Values { get; set; } = new();
}Hi,
I am using RadNavigationViewControl with RadDocking inside in the mainWindow, main view.
like this:
<RadNavigationView>
<RadNavigationView.Content>
<RadDocking>
<RadDocking.DocumentHost>
<RadPaneGroup Name=mainPaneGroup/>
</RadDocking.DocumentHost>
</RadDocking>
</RadNavigationView.Content>
</RadNavigationView>
When I open the new menu, new RadPane is Created inside RadPaneGroup, and I want it to be isFloatable and isDockable.
But the problem is that when I unload radpane, the radpane unloaded is not "Dockable" to any of control.
When I remove RadNavigationView and put RadDocking independently, RadDocking itself and contents inside work fine.
Is there a way to implement RadDocking inside RadNavigationView Content?

Hi Telerik Team,
I looked at the example below and tried the same,
but it came out like the attached picture
I want know if it is possible to change the width of SettingsPaneView.
regards,
PROBLEM
When you have a WPF RadGridView based on Table of many columns, consequently the Horizontal Scrollbar appear in Last row's as shown below. As the user scrolls to the bottom, it is look like the last row is not fully visible, its content has been cut.
Note : Theme Setting Mechanisms
Using Implicit Styles In this case use NoXaml dlls.
QUESTION : How can show Horizontal scrollbar correctly like :
CAUSE & SOLUTION plz?
Codebase available here : https://github.com/CrownParkComputing/MegaDownloaderFinal
so using the FolderDialog example for wpf, The binding for the propertt FolderName does not update after selecting a new folder. The original assignment works fine?
Errors shown :
FolderName property not found on object of type String.
IsSearchActive property not found on object of type OpenFolderDialogViewModel.
ItemTemplate and ItemTemplateSelector are ignored for items already of the ItemsControl's container type RadWatermarkTextBox
Please help with these issues I am stumped.
Is there a quicker way of selecting / deselecting groups of children items in RadTreeListView ??
if (e.AddedItems.Count > 0)
{
foreach (NodesModel i in e.AddedItems)
{
if (i.Name != "WHDLoad")
{
if (i.Items.Count > 0)
{
foreach (NodesModel x in i.Items)
{
{
//x.IsSelected = true;
Nodes.SelectedItems.Add(x);
}
}
}
}
}
}