Telerik Forums
UI for WPF Forum
1 answer
156 views

I am trying to add a list of lists of lists to a radtreeView but the child elements never appear, I have used a HeirichalDataTemplate as a test for the first 2 elements, is there something I am missing , given the following xalm 

<pre>

<telerik:RadTabItem Header="Lookup Sets">
                            <telerik:RadTreeView IsLoadOnDemandEnabled="True" ItemsSource="{Binding AttributeLookupSetConversions}">
                                <telerik:RadTreeView.Resources>
                                    <HierarchicalDataTemplate DataType="{x:Type cm:AttributeLookupSetConversion}">
                                        <CheckBox Content="{Binding Path=Name}"  IsChecked="{Binding Path=IsSelected, Mode=TwoWay}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerikDocking:RadSplitContainer}}, Path=DataContext.UpdateSelectionCommand}"/>
                                    </HierarchicalDataTemplate>
                                    <HierarchicalDataTemplate DataType="{x:Type cm:AttributeConversion}">
                                        <CheckBox Content="{Binding Path=Name}"  IsChecked="{Binding Path=IsSelected, Mode=TwoWay}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerikDocking:RadSplitContainer}}, Path=DataContext.UpdateSelectionCommand}"/>
                                    </HierarchicalDataTemplate>
                                </telerik:RadTreeView.Resources>
                            </telerik:RadTreeView>
                        </telerik:RadTabItem>

</pre>

 

I cant seem to get the UI to show its child elements

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Mar 2017
1 answer
158 views

Hi, 

Is it possible to change the way that MDX is generated by the PivotGrid when filters are applied? 

Currently when I apply a Month filter in my time dimension for e.g., this is done by adding the filter value as a sub-cube query in the from clause, rather than placing it in the WHERE clause. 

So instead of having 

 

SELECT x ON 0, y ON 1

FROM <cube>

WHERE ([time].[month].&[z])

 

The pivot grid generates

 

SELECT x ON 0, y ON 1
FROM (SELECT [time].[month].&[z]  FROM <cube>)

 

This is generally fine, but when we have calculated measures in the cube which rely on knowing where you are in the time hierarchy, (i.e. [time].[month].currentmember) then this distorts the calculation because the scope is handled in the sub-cube and the main query believes that [time].[month].currentmember is 'All' rather than Month Z as the query above suggests. 

 

Is there a way to tell the grid to use the former method? Failing that, how can we access the time filter from the calculations? 

 

Polya
Telerik team
 answered on 08 Mar 2017
2 answers
195 views
I want to change to format of the map mouse location indicator to decimal degrees.

In the help it shows how to do this if the indicator is OUTSIDE the map control (http://www.telerik.com/help/wpf/radmap-features-mouse-location.html).

I want to do this with the built-in indicator. How can I do this please?
Luis
Top achievements
Rank 1
 answered on 08 Mar 2017
8 answers
646 views
I try to use RadTreeView in my WPF MVVM Prism 6 application project. But when I put RadTreeView in UserControl area then it is underlined with blue wavy line and if I move the mouse cursor to this line the next error message is displayed: "Object reference not set to an instance of an object". I've added references to the following assemblies: Telerik.Windows.Controls, Telerik.Windows.Controls.Navigation, Telerik.Windows.Controls.Data. But I have the abovementioned error. What the reason of it. Please help me eliminate this error situation.
Martin Ivanov
Telerik team
 answered on 08 Mar 2017
1 answer
112 views
Is it possible to Bind a command while drag and drop? Instead of using code behind?
Martin Ivanov
Telerik team
 answered on 08 Mar 2017
13 answers
495 views

I have a GridViewDataColumn in which I need the cells to use/display a mask both in view/edit mode. In order to do this I have set the CellTemplate and the CellEditTemplate as you can see below. I cannot use the GridViewMaskedInputColumn because it does not allow me to specify different masks per cell. One mask per column will not work in my scenario (see attached picture). 

There is a slight difference between view and edit mode that I would like help with. In edit mode, the RadMaskedTextBox fills the cell, but in view mode, the RadMaskedTextBox does not quite fill the cell. I would like masked textbox to fill the cell regardless of whether it is in edit or view mode.

 

I have considered putting a Margin="3,0,0,0" on the CellEditTemplate, this means the textbox will not fill the cell in either view/edit mode - not idea....

 

<telerik:GridViewDataColumn
    Header="Value"  
    ValidatesOnDataErrors="InEditMode"
    DataMemberBinding="{Binding Value}"
    Width="*">
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <telerik:RadMaskedTextInput
                Mask="{Binding ValueMask}"
                Value="{Binding Value}"
                TextMode="MaskedText"
                IsEnabled="False"
                SelectionOnFocus="CaretToBeginning"
                IsLastPositionEditable="False"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"/>
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
    <telerik:GridViewDataColumn.CellEditTemplate>
        <DataTemplate>
            <telerik:RadMaskedTextInput
                Mask="{Binding ValueMask}"
                Value="{Binding Value}"
                TextMode="MaskedText"
                SelectionOnFocus="CaretToBeginning"
                IsLastPositionEditable="False"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"/>
        </DataTemplate>
    </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>

 

SB
Top achievements
Rank 1
 answered on 07 Mar 2017
1 answer
174 views

Hi!

There is any way to create custom aggregate for QueryableDataProvider?

I want to create CustomDistinct aggregate, I did it successfully for LocalDataSourceProvider, and I need it also for QueryableDataProvider.

Here is my code, unfortunately, it is not working at all..

Hi!
There is any way to create custom aggregate for QueryableDataProvider?
I want to create CustomDistinct aggregate, I did it successfully for LocalDataSourceProvider, and I neet also for QueryableDataProvider.
Here is my code, unfurtonately, it is not working at all..

I see "CountDistinct" in "More aggregate options" window, but when i choose it, the pivot got an error.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Telerik.Pivot.Core;
using Telerik.Pivot.Core.Fields;
using Telerik.Pivot.Queryable;
 
namespace YA.Pivot.Queryable
{
    public class MyQueryableDataProvider : QueryableDataProvider
    {
        protected override void OnPrepareDescriptionForField(PrepareDescriptionForFieldEventArgs args)
        {
            base.OnPrepareDescriptionForField(args);
            if (args.DescriptionType == DataProviderDescriptionType.Aggregate)
            {
                var old = args.Description as QueryablePropertyAggregateDescriptionBase;
 
                args.Description = new CustomPropertyAggregateDescription()
                {
                    PropertyName = old.PropertyName,
                    FunctionName = old.FunctionName,
                    AggregateFunction = old.AggregateFunction,
                    CustomName = old.CustomName,
                    StringFormat = old.StringFormat
                };
            }
        }
    }
 
    internal class CustomPropertyAggregateDescription : QueryablePropertyAggregateDescriptionBase
    {
        private enum MyAggregateFunctions
        {
            CountDistinct = -100
        }
 
        protected override Cloneable CreateInstanceCore()
        {
            return new CustomPropertyAggregateDescription()
            {
                AggregateFunction = this.AggregateFunction,
                CustomName = this.CustomName,
                FunctionName = this.FunctionName,
                PropertyName = this.PropertyName,
                StringFormat = this.StringFormat,
                StringFormatSelector = this.StringFormatSelector,
                TotalFormat = this.TotalFormat
            };
        }
 
        private bool IsCountDistinct => (int)base.AggregateFunction == (int)MyAggregateFunctions.CountDistinct;
 
        protected override Expression CreateAggregateExpression(Expression enumerableExpression, string aggregatedValueName)
        {
            if (enumerableExpression == null)
            {
                throw new ArgumentNullException(nameof(enumerableExpression));
            }
 
            if (IsCountDistinct)
            {
                return CreateCountDistinctExpression(enumerableExpression, aggregatedValueName);
            }
 
            return base.CreateAggregateExpression(enumerableExpression, aggregatedValueName);
        }
 
        private Expression CreateCountDistinctExpression(Expression enumerableExpression, string aggregatedValueName)
        {
            Type itemType = TypeExtensions.ExtractItemTypeFromEnumerableType(enumerableExpression.Type);
            var selectParamExp = Expression.Parameter(itemType, "e");
            var selectPropAccessExp = Expression.Property(selectParamExp, aggregatedValueName);
            LambdaExpression selectLambdaExpression = Expression.Lambda(selectPropAccessExp, selectParamExp);
 
            var select = Expression.Call(
              typeof(Enumerable),
              "Select",
              new[] { itemType, selectLambdaExpression.Body.Type },
              enumerableExpression,
              selectLambdaExpression);
 
            var distinct = Expression.Call(
                typeof(Enumerable),
                "Distinct",
                new[] { selectLambdaExpression.Body.Type },
                select);
 
            var count = Expression.Call(
                typeof(Enumerable),
                "Count",
                new[] { selectLambdaExpression.Body.Type },
                distinct);
 
            return count;
        }
 
        protected override IEnumerable<object> SupportedAggregateFunctions =>
                base.SupportedAggregateFunctions.Concat(new object[] { MyAggregateFunctions.CountDistinct });
    }
 
    internal static class TypeExtensions
    {
        public static Type ExtractItemTypeFromEnumerableType(Type type)
        {
            var enumerableType = type.FindGenericType(typeof(IEnumerable<>));
 
            if (enumerableType == null)
            {
                throw new ArgumentException("Provided type is not IEnumerable<>", nameof(type));
            }
 
            return enumerableType.GetGenericArguments().First();
        }
 
        private static Type FindGenericType(this Type type, Type genericType)
        {
            while (type != null && type != typeof(object))
            {
                if (type.IsGenericType && type.GetGenericTypeDefinition() == genericType)
                {
                    return type;
                }
 
                if (genericType.IsInterface)
                {
                    foreach (Type intfType in type.GetInterfaces())
                    {
                        Type found = intfType.FindGenericType(genericType);
 
                        if (found != null)
                        {
                            return found;
                        }
                    }
                }
 
                type = type.BaseType;
            }
 
            return null;
        }
    }
}
Polya
Telerik team
 answered on 07 Mar 2017
3 answers
262 views

I have used RadGridView with data collection binded to it.

When I try to search for value in selected column with Filter pop up, on selected column,

I am able to filter collection with checkbox selection.

But when I enter value in the pop textbox and press filter button.

It is not filtering the collection.

 

I have checked both Distinct  and filed filter properties of ColumnFilterDescriptor .It seems to look correct .

Can anybody please help me out to solve the problem?

 

Dilyan Traykov
Telerik team
 answered on 06 Mar 2017
8 answers
1.7K+ views

Hello Telerik,

I wanted to do something similar as this:

<telerik:RadWatermarkTextBox WatermarkContent="{Resx WatermarkTextBox_AddNew }"
                                                   Visibility="{Binding IsNew, Converter={StaticResource VisibilityConverter}}">
                                    <telerik:RadWatermarkTextBox.WatermarkTemplate>
                                        <DataTemplate>
                                            <!--TODO: Do your custom styling here. -->
                                            <TextBlock Style="{StaticResource TextBlockValueDefaultStyle}" Text="{Binding}" />
                                        </DataTemplate>
                                    </telerik:RadWatermarkTextBox.WatermarkTemplate>
                                </telerik:RadWatermarkTextBox>

but for the TextBox part of the control

is there an easy way to do so?

 

Thank you

Nasko
Telerik team
 answered on 06 Mar 2017
10 answers
212 views

when using radwindow.alert,  there is  a small probability case to throw an System.ArgumentOutOfRangeException,  

is any solution to avoid this ? 

Nasko
Telerik team
 answered on 06 Mar 2017
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?