Telerik Forums
UI for WPF Forum
3 answers
283 views
I'm using the RadTreeListView v4.0.30319 to display my hierarchical data set. I know this is an older version but breaking changes in the newer version of the GridView (the ones that cause data duplication on refreshing) mean I can't upgrade.

My problem is this.

My TreeListView has a two-way binding on the SelectedItem property. If I add a new item to the underlying hierarchical data, it appears in the grid and is selected how I would expect, but only if the branch of the tree I am adding to is expanded. If I add a new item to a currently collapsed group, the proeprty I am binding to (SelectedLocation in my case) updates as expected but the parent branch remains collapsed and the tree's rendering does not change. This makes it look like the previously selected item is still selected.
Is there a solution to this that is pure MVVM (ie. no code behind the window)?

I have tried setting the AutoExpandGroups to true to see if this helped. However, there appears to be a bug in this. In my data I have two root objects, each with several children, grandchildren, etc. When I have AutoExpandGroups set to true, only the first root and the first child are displayed. Everything else only appears if you collapse and re-expand nodes. I'm assuming I'm stuck with this because of not being able to upgrade to the later version of the controls due to the breaking change in the GridView.

My current TreeListView's XAML is:

    <Grid Visibility="{Binding .,Converter={StaticResource PermissionCodeConverter},ConverterParameter='SHOW LOCATIONS'}">
        <telerik:RadTreeListView Name="LocationTree"
                                 ItemsSource="{Binding Locations}"
                                 SelectedItem="{Binding SelectedLocation,Mode=TwoWay}"
                                 IsReadOnly="True"
                                 AutoGenerateColumns="False"
                                 CanUserFreezeColumns="False"
                                 CanUserReorderColumns="False"
                                 RowIndicatorVisibility="Collapsed"
            <telerik:RadTreeListView.SortDescriptors>
                <telerik:SortDescriptor Member="Name" SortDirection="Ascending"/>
            </telerik:RadTreeListView.SortDescriptors>
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding ChildLocations}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" Width="200">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="{Binding IconResourcePath}" Width="16" Height="16" HorizontalAlignment="Left" Margin="0 0 8 0"/>
                                <TextBlock Text="{Binding Name}"/>
                            </StackPanel>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding LocationType.Description}" Header="Type" Width="175" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding CheckDigits}" Header="Check Digits" Width="115" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding DisplayablePalletLimit}" Header="Maximum Pallets" Width="125" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Status}" Header="Status" Width="100" />
            </telerik:RadTreeListView.Columns>

            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu x:Name="GridContextMenu">
                    <telerik:RadContextMenu.Items>
                        <telerik:RadMenuItem Header="Create Child" Command="{Binding CreateChildLocationCommand}">
                            <telerik:RadMenuItem.IconTemplate>
                                <DataTemplate>
                                    <Image Source="..\Images\16x16\Create.png"/>
                                </DataTemplate>
                            </telerik:RadMenuItem.IconTemplate>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem Header="Edit" Command="{Binding EditLocationCommand}" Style="{StaticResource DefaultContextMenuItem}">
                            <telerik:RadMenuItem.IconTemplate>
                                <DataTemplate>
                                    <Image Source="..\Images\16x16\Edit.png"/>
                                </DataTemplate>
                            </telerik:RadMenuItem.IconTemplate>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem Header="Delete" Command="{Binding DeleteLocationCommand}">
                            <telerik:RadMenuItem.IconTemplate>
                                <DataTemplate>
                                    <Image Source="..\Images\16x16\Delete.png"/>
                                </DataTemplate>
                            </telerik:RadMenuItem.IconTemplate>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem IsSeparator="True" />
                        <telerik:RadMenuItem Header="Enable" Command="{Binding EnableLocationCommand}">
                            <telerik:RadMenuItem.IconTemplate>
                                <DataTemplate>
                                    <Image Source="..\Images\16x16\Enable.png"/>
                                </DataTemplate>
                            </telerik:RadMenuItem.IconTemplate>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem Header="Disable" Command="{Binding DisableLocationCommand}">
                            <telerik:RadMenuItem.IconTemplate>
                                <DataTemplate>
                                    <Image Source="..\Images\16x16\Disable.png"/>
                                </DataTemplate>
                            </telerik:RadMenuItem.IconTemplate>
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem IsSeparator="True" />
                        <telerik:RadMenuItem Header="Refresh" Command="{Binding RefreshCommand}">
                            <telerik:RadMenuItem.IconTemplate>
                                <DataTemplate>
                                    <Image Source="..\Images\16x16\Refresh.png"/>
                                </DataTemplate>
                            </telerik:RadMenuItem.IconTemplate>
                        </telerik:RadMenuItem>
                    </telerik:RadContextMenu.Items>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

        </telerik:RadTreeListView>

Nick
Telerik team
 answered on 06 May 2013
12 answers
351 views
I have a GridView in its own window which opens from a menu click. It's bound to a table in an SQLite database using an ObjectQuery on an Entity Data Model. The table has 150,000 rows and 50 columns. It takes 15 seconds from the window opening before the first page of data is displayed, with a blank window displayed. I then set the DataLoadMode to Asynchronous, and now when the window opens, I get the column headers displayed, and the 'busy' indicator, which is an improvement, but it still takes 15 seconds to show the first page of data.

If your demo is loading a million rows in 2 seconds, what am I doing wrong?

One problem with setting the DataLoadMode to Asyncronous is that when I edit a cell, the 'busy' indicator comes back on, and the first page of the data is displayed again. My CellEditEnded handler just calls the SaveChanges() method of my Entities object. Should I be doing it a different way to avoid being taken back to the start of the data?

Steve
Rossen Hristov
Telerik team
 answered on 06 May 2013
7 answers
67 views
I'm binding a RadGridView to a collection of objects that implement INotifyPropertyChanged. Sometimes the properties on those objects are changed by a thread that isn't the gui thread. This causes a "calling thread cannot access this object" error.

I understand that normally non gui threads can't access gui objects, but in this case it should work, in every other WPF control I use it works fine, presumably because behind the scenes they use Dispatcher.Invoke(...) on all propertychanged notifications.

thanks
Rossen Hristov
Telerik team
 answered on 06 May 2013
7 answers
571 views
Hello,

I am using this control and am having negative feedback because users cannot type in .6 for example and get the control to display 0.6.
Instead if you type .6 the control actually displays 6.0. Is there anything that can be done about this??

Thanks.


<RadMaskedNumericInput Value="{ Binding BgsPremiumRate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"  FormatString="n2" InputBehavior="Replace" Mask="" SelectionOnFocus="SelectAll"  TextMode"PlainText" />
Petar Mladenov
Telerik team
 answered on 06 May 2013
0 answers
235 views

Dear All,

I am create a Point Of Sales System in WPF. I want to print invoice while completion of Order. Data Will be provided from TextBox for Invoice,

(txtinvoices, txtQty, txtTotalPrice, txtAmountPaid and txtDate) are some textbox i want to print on Invoices. There is one barcode Image as well for each order that is needed to print on Invoice.

Anyone can help me in printing in WPF ???

Thanks in Advance

Jazaib Hussain
Jazaib
Top achievements
Rank 1
 asked on 05 May 2013
11 answers
290 views
Hello
I am trying to save the RadPivotGrid after user has defined the pivot through the RadPivotFieldList, so when i will load it 
it will load with all of the definition. I understand that most of it is stored in the LocalDataSourceProvider.
is there way to save and restore the LocalDataSourceProvider to a file?

Regards,

Amir

 . 

										
Rosen Vladimirov
Telerik team
 answered on 04 May 2013
5 answers
233 views
Imagine a carousel, and on each carousel pane there is something that looks like a vertically oriented business card or a property grid, with interactive data-entry fields. Some of the data fields are textboxes, some are radio button groups, and some are datepickers, some are simple dropdown lists, and one is a "popout" notes field. Is something like this possible in WPF?  Would there be a way to search rapidly through the dataset (it could contain as many as  10,000 items) and when  a match is found, the carousel would "zoom" that record into the focused pane of the carousel?


Maya
Telerik team
 answered on 03 May 2013
0 answers
89 views
Hi
I am looking to Change the AutoHide value using MVVM, but i don't know where is the property that change this.

Please let me know if this can be done using Telerik last version,

Thanks,
Akram
Akram
Top achievements
Rank 1
 asked on 03 May 2013
3 answers
145 views
I'm having issues with multi-selection of my treeview and I'm wondering what I'm doing wrong. I'm trying to get multi-select to work the way I expect on the RadTreeView, however I've found that every time I hold the ctrl key and shift key simultaneously, it seems to ignore the shift key and acts only in the normal ctrl key selection mode (where it selects only the item being clicked, rather than being able to click on an item with the ctrl key, then a second item with ctrl shift and select the new block, leaving any existing selection alone). Normal shift-select works as expected, and normal ctrl-select works just fine too, but ctrl-shift select just seems to work no differently than plain ctrl select, so like its ignoring the shfit key in that circumstance.

If you've read my post history, you may have read that I was trying to override default treeview selection behavior previously, but thankfully the project specification changed to just do the default windows treeview selection style, so I removed all previous overrides of event handlers I had in place and I'm just trying to use extended selection mode.

My xaml:

<UserControl x:Class="LasX.ApplicationFramework.Cad.EntityTreeView"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="TreeViewTemplates.xaml" />               
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <telerik:RadTreeView Name="treeView1"
                     HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                     telerik:TreeViewPanel.IsVirtualizing="True"
                     telerik:TreeViewPanel.VirtualizationMode="Recycling"
                     ItemTemplate="{StaticResource EntityDataTemplate}"
                     ItemsSource="{Binding CadEntityManager, UpdateSourceTrigger=PropertyChanged}"
                     ItemContainerStyle="{StaticResource RadTreeViewItemStyle1}"
                     Background="#FF212830"
                     SelectionChanged="treeView1_SelectionChanged"
                     SelectionMode="Extended"
                      >
        </telerik:RadTreeView>
    </Grid>
</UserControl>

Any clues as to what I may be doing wrong?

Thanks!
Tina Stancheva
Telerik team
 answered on 03 May 2013
2 answers
314 views
I am using a RadGridView with a bound QueryableCollectionView.

Virtualization is enabled

Anytime I scroll through the grid, memory usage of the application goes up and up and up, and never comes back down, even after forcing calls to GC.Collect().  Am I missing something here or is there some issue with scrolling through a QueryableCollectionView?

Thanks,
Brandon
Brandon
Top achievements
Rank 1
 answered on 03 May 2013
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
VirtualKeyboard
HighlightTextBlock
Security
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?