Telerik Forums
UI for WPF Forum
2 answers
148 views

Hi,

I use 2015 Q2. When I add mnemonic to label this way:

<telerik:Label Target="{Binding ElementName=InputName}" Grid.Row="0" Content="_Nazwa:"/>
<telerik:RadMaskedTextInput x:Name="InputName" Grid.Row="0" Grid.Column="1"/>

my label has additional margin at the beginning (space for non-existent underscore character?). Please see attached file.

When I remove underscore then label is aligned properly.

What can I do about it?

 

 

Lukasz
Top achievements
Rank 1
 answered on 29 Aug 2016
2 answers
387 views
Hi, I want a RadDiagramShape display in the viewport's center, there are many shapes in the RadDiagram. How to do it ?  I found the diagram's viewport.X and viewport.Y, but they are read-only, can not to set. Thanks!
Jonathan
Top achievements
Rank 1
 answered on 27 Aug 2016
1 answer
851 views

Hello,

Right now i am implementing a search button for my PDF toolbar.

all i need is the right icon. but i dont seem to find a list of the icons available 

{telerik:IconResource IconRelativePath=SEARCH_ICON_goes_here.png, IconSources={StaticResource IconPaths}

can someone help please?

 

thanks

Tanya
Telerik team
 answered on 26 Aug 2016
3 answers
203 views

I took an example for a TreeView where you filter items with a Boolean "IsRemovedByFilter". The example had the items re-created with a copy constructor.

I did the same on a tree list view, and replaced the copy constructor with ListCollectionView.EditItem and CommitEdit.

 

The more times you filter the items, the slower it gets.

 

Here is the code:

MainWindow:

<Window x:Class="TreeListView_Filtering_Issue.MainWindow"
        Title="MainWindow" Height="350" Width="525">
     
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
         
        <TextBox Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" />
         
        <telerik:RadTreeListView ItemsSource="{Binding Items}" AutoGenerateColumns="False" Grid.Row="1">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding FilteredChildren}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
             
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" IsReadOnly="True"/>
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
    </Grid>
</Window>

 

The data context is being set by (just a quick and dirty way for this example):

        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new MainViewModel();
        }

 

 

The ViewModels are:

public class MainViewModel : ViewModelBase
{
    private ObservableCollection<Person> _persons = new ObservableCollection<Person>();
    private ListCollectionView _items;
    private string _filterText = string.Empty;
 
    public MainViewModel()
    {
        for (int i = 0; i < 100; i++)
        {
            Person person = new Person(null)
            {
                Name = "Test" + i,
            };
 
            _persons.Add(person);
 
            for (int j = 0; j < 20; j++)
            {
                Person child = new Person(person)
                {
                    Name = "Child." + i + "." + j,
                };
 
                person.Children.Add(child);
            }
        }
 
        _items = new ListCollectionView(_persons);
        _items.Filter = nonFilteredChidrenPredicate;
    }
 
    internal static bool nonFilteredChidrenPredicate(object obj)
    {
        if (obj is Person)
        {
            return !(obj as Person).IsRemovedByFilter;
        }
        return false;
    }
 
    public ListCollectionView Items
    {
        get
        {
            return _items;
        }
    }
 
    public string FilterText
    {
        get
        {
            return _filterText;
        }
        set
        {
            if (value == null)
                value = string.Empty;
            _filterText = value;
            FilterItems();
        }
    }
 
    internal void FilterItems()
    {
        Queue<Person> queue = new Queue<Person>();
 
        foreach (var item in _persons)
        {
            queue.Enqueue(item);
        }
        while (queue.Count > 0)
        {
            Person current = queue.Dequeue();
            current.IsRemovedByFilter = false;
 
            if (current.Name.ToUpper().Contains(FilterText.ToUpper()))
            {
                current.IsRemovedByFilter = false;
                //if (!string.IsNullOrEmpty(FilterText))
                //{
                //    current.IsExpanded = true;
 
                //    if (selectedItem == null)
                //        selectedItem = current;
                //}
                // show and expand parent if one child fits with filter
                setParentFilterStatus(current);
            }
            else
            {
                current.IsRemovedByFilter = true;
            }
            // filter tree leaves
            if (current.Children.Count > 0)
            {
                foreach (var item in current.Children)
                {
                    queue.Enqueue(item);
                }
            }
        }
 
        foreach (var root in _persons)
        {
            Items.EditItem(root);
            Items.CommitEdit();
            refreshFilterStatus(root, root.Children);
        }
    }
 
    private void refreshFilterStatus(Person parent, IEnumerable<Person> items)
    {
        foreach (var item in items)
        {
            parent.FilteredChildren.EditItem(item);
            parent.FilteredChildren.CommitEdit();
        }
        foreach (var item in items)
        {
            refreshFilterStatus(item, item.Children);
        }
    }
 
    private void setParentFilterStatus(Person person)
    {
        Person currentPerson = person;
        while (currentPerson.Parent != null)
        {
            currentPerson.Parent.IsRemovedByFilter = false;
 
            //// if a filter is applied, expand parent's nodes
            //if (!string.IsNullOrEmpty(FilterText))
            //    currentPerson.Parent.IsExpanded = true;
 
            currentPerson = currentPerson.Parent;
        }
    }
}
 
public class Person : ViewModelBase
{
    public string Name { get; set; }
    public bool IsRemovedByFilter { get; set; }
    public Person Parent { get; private set; }
    public ObservableCollection<Person> Children { get; private set; }
    public ListCollectionView FilteredChildren { get; private set; }
 
    public Person(Person parent)
    {
        Children = new ObservableCollection<Person>();
        FilteredChildren = new ListCollectionView(Children);
    }
}

 

 

Run the example, and type the letter z. The filtering is fast. Delete the z, it now took a little more time.

Repeat this procedure few more times. You should notice that it becomes slower and slower each time (my guess would be event handlers leaking, but I didn't confirm it).

 

With dotTrace I can see that when the first z was typed, OnSourceViewColelctionChanged was called 5150 times.

The the z was deleted, OnSourceViewColelctionChanged was called 15150 times.

After repeating it 5 more times, OnSourceViewColelctionChanged was called 105150 times when the z was typed, and  115150 times when the z was deleted.

 

 

 

Currently, it is much faster (also due to virtualization) to just refresh the entire ListCollectionView

Ivan Ivanov
Telerik team
 answered on 26 Aug 2016
14 answers
269 views

Hi!

I just installed the latest release of UI for WPF (Q1 2016) via control panel. What I noticed is that most of the installed assemblies are compiled on 01/12/2016, however some of them are compiled on 01/06/2016. This also means that the assemblies have different product versions.

Example (from Binaries.NoXaml/WPF45): Telerik.Windows.Control.dll (2016.1.112.45), Telerik.Windows.Documents.Core.dll (2016.1.106.45).

This never happened before, all files of a release normally had the same build date. Since I build my projects using special target files including the version number of each assembly this is very annoying. Please correct this in the next build.

Regards
Heiko

EDILSON MARTINS
Top achievements
Rank 1
 answered on 26 Aug 2016
1 answer
354 views

Hello.

I have a WPF MVVM application with several screens with grids. I currently use FilteringMode="FilterRow" on these grids. The problem I'm having is that after each filter is changed and loses focus, a database trip is made. This is very expensive and slow (going through OData and EF). I would like to defer all filtering until the user clicks a button. I can do this now by not binding a command to the Filtered event, but a change in filter still filters the grid page that currently has focus.

I have done some searching around and I do see that it's not possible to defer filtering when using FilterRow but I would like to explore what options I do have. Popup mode is not an option here as there's too much code to switch out. I saw Custom Filtering as an option but keep in mind that I have lots of grids each with lots of columns (my grid I'm testing with has 56 columns) and I have to be able to apply this across the board.

What I'm ultimately looking for is a way for a user to type their filters into whatever fields they choose and then click 1 button to apply all of them at once. The grid should not update at all when each field loses focus.

Any suggestions?

Dilyan Traykov
Telerik team
 answered on 26 Aug 2016
1 answer
83 views

Hi,

I would like know it is possible to customize label inside each segment with  a new property of our custom task.

What is the best way for that?

 

Thanks,

regards.

Polya
Telerik team
 answered on 26 Aug 2016
1 answer
239 views
I am running into issues with IsExpanded in our hierarchial RadGridView.

We have the IsExpanded property bound in a style, using the following statement:

<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />

This works up until the GridView has enough items that it needs to scroll.   If the user scrolls, the binding to IsExpanded gets messed up due to Virtualization.

So I set EnableRowVirtualization="False" on the grid and that fixed the problem. 

HOWEVER, now when a user hits our "Expand All" button, it takes FOREVER to expand all of our rows, upwards of several minutes.   With Row Virtualization, it took a few seconds.  So clearly we can't do this.

How should I be attempting to do this?  Is there a different way we should be handling IsExpanded that will allow us to work with Row Virtualization turned on?   We are MVVM and I'd prefer to handle this in our ViewModel like we currently are, but I don't mind stuffing a few things into the code behind if it means fixing this problem.

Thank you for any direction you can give us on this issue. 
Stefan
Telerik team
 answered on 26 Aug 2016
1 answer
706 views
Hello as I can make the RadGridView the Control GridViewSelectColumn cheked dependiento a value that is if the value variable equals or "client" appears appears that the checkbox selected
Stefan
Telerik team
 answered on 26 Aug 2016
3 answers
138 views

Hello Telerik Team,

 

I am facing some issue when trying to load a page with a PDF, just like we find on your updated SDK Samples Browser (PdfViewer -> Change Scale Factor)

basically I just added the required assemblies we see here http://docs.telerik.com/devtools/wpf/controls/radpdfviewer/getting-started , and copied and pasted the code from that sample

The sample runs fine. Even with my PDF on it.

But I am having the error you can see in the attached picture when I place it on my solution.

Is there anything I am missing?

 

Thank you

Jacob
Top achievements
Rank 1
 answered on 26 Aug 2016
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?