Telerik Forums
UI for WPF Forum
2 answers
98 views
Hello,
Sorry for the bad title. I could not guess what kind of an problem it was.
Bellow is our .xaml and .cs codes. After adding an amount of values to the grid, the grid throws an exception. I gave all of the code at the page because there was another thread about this subject and "telerik" had requested to code.
Generally it gives the error after 20-30 records added to the grid.

The computer specs where the application is used:
1. Ultra mobile pc
2. Atom processor
3. Windows 7 with .net framework 3.5

we are using 2010.1.603.35 version of telerik.


<base:PageBase x:Class="Shop.App.WPF.Pages.Secured.CycleCount.PageCycleCount"
      xmlns:base="clr-namespace:Shop.App.WPF.Pages.Base"
      mc:Ignorable="d"
      d:DesignHeight="600" d:DesignWidth="900"
    Title="Sayım">
 
    <Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type base:PageBase}, Mode=FindAncestor}, Path=CycleCountService}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
         
        <StackPanel Grid.Row="0" Orientation="Horizontal" >
            <TextBlock Margin="5" Style="{StaticResource StyleTextBlock}" VerticalAlignment="Center" Text="Depo"></TextBlock>
            <ComboBox Name="ComboBoxWarehouse" MinWidth="150" Margin="5" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type base:PageBase}, Mode=FindAncestor}, Path=WarehouseContext.Values}" SelectedIndex="0" DisplayMemberPath="Name" SelectionChanged="ComboBoxWarehouse_SelectionChanged"></ComboBox>
        </StackPanel>
         
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <TextBlock Style="{StaticResource StyleTextBlock}" Text="Stok Kodu" Margin="5" VerticalAlignment="Center"></TextBlock>
            <TextBox Margin="5" VerticalAlignment="Center" Name="TextBoxItemStockCode" Width="200" KeyDown="TextBoxItemStockCode_KeyDown"></TextBox>
            <TextBlock Style="{StaticResource StyleTextBlock}" Text="Adet" Margin="5" VerticalAlignment="Center"></TextBlock>
            <Telerik:RadNumericUpDown Margin="5" Minimum="1" IsInteger="True" x:Name="NumericPieces"></Telerik:RadNumericUpDown>
            <TextBlock Text="{Binding Path=ProductDataContext.Value.ItemName}" Margin="5" VerticalAlignment="Center" Name="TextBlockItemName" Width="Auto" TextWrapping="Wrap"></TextBlock>
        </StackPanel>
         
        <Telerik:RadGridView
            Margin="5"
            Grid.Row="2"
            x:Name="GridItems"
            AutoGenerateColumns="False"
            ItemsSource="{Binding Path=CycleCountItemContext.Values}"
            >
            <Telerik:RadGridView.Columns>
                <Telerik:GridViewDataColumn Header="Stok Kodu" DataMemberBinding="{Binding Path=ItemStockCode}"></Telerik:GridViewDataColumn>
                <Telerik:GridViewDataColumn Header="Stok Adı" DataMemberBinding="{Binding Path=ItemName}"></Telerik:GridViewDataColumn>
                <Telerik:GridViewDataColumn Header="Stok Bakiye" DataMemberBinding="{Binding Path=StartCount}"></Telerik:GridViewDataColumn>
                <Telerik:GridViewDataColumn Header="Satılan Miktar" DataMemberBinding="{Binding Path=SoldCount}"></Telerik:GridViewDataColumn>
                <Telerik:GridViewDataColumn Header="Sayılan" DataMemberBinding="{Binding Path=Counted}"></Telerik:GridViewDataColumn>
                <Telerik:GridViewDataColumn Header="Son Bakiye" DataMemberBinding="{Binding Path=EndCount}"></Telerik:GridViewDataColumn>
                <Telerik:GridViewDataColumn Header="Kategori" DataMemberBinding="{Binding Path=Product.Category.Name}"></Telerik:GridViewDataColumn>
            </Telerik:RadGridView.Columns>
        </Telerik:RadGridView>
    </Grid>
</base:PageBase>

namespace Shop.App.WPF.Pages.Secured.CycleCount
{
    /// <summary>
    /// Interaction logic for PageCycleCount.xaml
    /// </summary>
    public partial class PageCycleCount : PageBase, INotifyPropertyChanged
    {
        private WarehouseContext _WarehouseContext;
 
        public WarehouseContext WarehouseContext
        {
            get { return _WarehouseContext; }
            set
            {
                _WarehouseContext = value;
                PropertyChanged(this, new PropertyChangedEventArgs("WarehouseContext"));
            }
        }
 
        private CycleCountService _CycleCountService = null;
        public CycleCountService CycleCountService
        {
            get
            {
                return _CycleCountService;
            }
            set
            {
                _CycleCountService = new CycleCountService();
                PropertyChanged(this, new PropertyChangedEventArgs("CycleCountService"));
            }
        }
 
        public PageCycleCount()
        {
            PropertyChanged += new PropertyChangedEventHandler(PageCreateNew_PropertyChanged);
 
            CycleCountService = new Business.Services.CycleCountService();
            WarehouseContext = new Business.Contexts.WarehouseContext();
            InitializeComponent();
 
            WarehouseContext.LoadAll();
            CycleCountService.LoadActiveCountItems(WarehouseContext.Values.FirstOrDefault().ID);
        }
 
        void PageCreateNew_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
 
        }
 
        #region INotifyPropertyChanged Members
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        #endregion
 
        private void TextBoxItemStockCode_KeyDown(object sender, KeyEventArgs e)
        {
            CycleCountItem item = null;
 
            try
            {
                if (e.Key == Key.Enter)
                {
                    item = CycleCountService.AddCount(
                        (ComboBoxWarehouse.SelectedItem as Warehouse).ID,
                        TextBoxItemStockCode.Text,
                        Convert.ToInt32(NumericPieces.Value));
                    NumericPieces.Value = 1;
                    GridItems.ScrollIntoView(item);
                    GridItems.SelectedItem = item;
                    TextBoxItemStockCode.Text = "";
 
                    CycleCountService.LoadActiveCountItems((ComboBoxWarehouse.SelectedItem as Warehouse).ID);
                }
            }
            catch (UserException exc)
            {
                SendErrorMessage(exc.Message);
            }
            catch (Exception exc)
            {
                CommonExceptionAction(exc);
            }
        }
 
        private void ComboBoxWarehouse_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                CycleCountService.LoadActiveCountItems((ComboBoxWarehouse.SelectedItem as Warehouse).ID);
            }
            catch (UserException exc)
            {
                SendErrorMessage(exc.Message);
            }
            catch (Exception exc)
            {
                CommonExceptionAction(exc);
            }
        }
    }
}

The Error :

PresentationHost.exe Error: 0 : System.NullReferenceException:
target: Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Remove(GeneratorPosition position, Int32 count, Boolean isRecycling)
   target: Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IRecyclingItemContainerGenerator.Recycle(GeneratorPosition position, Int32 count)
   target: Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupRange(IList children, IItemContainerGenerator generator, Int32 startIndex, Int32 count)
   target: Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupContainers(Int32 firstViewport, BaseItemsControl itemsControl)
   target: Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   target: System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Control.MeasureOverride(Size constraint)
   target: Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Page.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Control.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Control.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Control.MeasureOverride(Size constraint)
   target: Telerik.Windows.Controls.RadTabControl.MeasureOverride(Size availableSize)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Control.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: Telerik.Windows.Controls.DockingPanel.MeasureOverride(Size availableSize)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Control.MeasureOverride(Size constraint)
   target: Telerik.Windows.Controls.RadDocking.MeasureOverride(Size availableSize)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   target: System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Page.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   target: System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   target: System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Controls.Border.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.Window.MeasureOverrideHelper(Size constraint)
   target: System.Windows.Window.MeasureOverride(Size availableSize)
   target: MS.Internal.AppModel.RootBrowserWindow.MeasureOverride(Size constraint)
   target: System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   target: System.Windows.UIElement.Measure(Size availableSize)
   target: System.Windows.ContextLayoutManager.UpdateLayout()
   target: System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   target: System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   target: System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   target: System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   target: System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   target: System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   target: System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Dogu
Top achievements
Rank 1
 answered on 21 Jul 2010
1 answer
57 views
to incorporate a windows form for each tile we have.On click of the tile, i want to open up a form associated with the tile. Please let me know. If you have a sample app which does this, it would be great. Thanks.
Valentin.Stoychev
Telerik team
 answered on 21 Jul 2010
7 answers
152 views
Everything in my project is now working perfectly except for when I add an ItemContainerStyle to the main treeview.   My data binding is messed up and none of the HierarchicalDataTemplate styling is applied for the first level.  When I remove the ItemContainerStyle from the main tree, everything works perfectly.

I have uploaded my project since this example has grown quite large.


Thanks

Ryan
Miro Miroslavov
Telerik team
 answered on 21 Jul 2010
1 answer
151 views
Hi All,

This may be silly question. But could not find the answer for this in the forum also. The Question is, How will I change the Width of the Bar in the Bar Chart?

Regards,
Arun
Arun
Top achievements
Rank 1
 answered on 21 Jul 2010
1 answer
78 views
Since upgrading to the newest version of the Telerik Control, the current item no longer changes.
Milan
Telerik team
 answered on 21 Jul 2010
4 answers
140 views
Dear forums,

Right now I have a grid (2010.2.714.40) that uses the DefaultView of a DataTable as an ItemsSource.  Unfortunately using something other than DataTables in not an option in my scenario.  I have a custom IFilterDescriptor which lets me filter the grid based on some complicated rules.  The filter works when it is applied, but if the data in the row changes, the filter is not reapplied.  Looking at this forum post it seems like that is the expected behavior.  Regardless, I need it to work the other way.  The alternatives suggested in that thread are not viable in my situation because it is too expensive to recreate/reset the collection view (thus reapplying the filter on each row) every time a field changes.  Are there any other alternatives?

My idea for a workaround was to add a layer of abstraction between the data table and the ItemsSource and do the filtering there instead of using the Grid's built in filtering.  This is doable because the filters are created outside of the Grid's filtering UI.  My FilteredCollectionView class took the DataTable as a member, and listened for changes to the table.  With each row change event it applied the filter on the modified row, and added/removed the DataRow as necessary to an ObservableCollection<DataRow>.  I then set the Grid's ItemsSource to that ObservableCollection.  

Sadly this is not working as expected.  Whenever I try to use my collection, I get errors like these for each column:  Property <PropertyName> not defined for type DataRow at Telerik.Windows.Data.PropertyPathDescriptor.GetPropertyDescriptor(PropertyToken token, Type componentType).  

I suspect it is occurring because of the dynamic nature of DataTables/DataRows and how the grid deals with them internally; it probably knows how to handle DataRows when the ItemsSource is a DataTable, but it never expects to see DataRows in a normal collection.

Any solutions to my current workaround, or suggestions of other workarounds will be greatly appreciated.

Thanks,
Tom
Tom
Top achievements
Rank 1
 answered on 20 Jul 2010
2 answers
213 views
Hi,

I recently found out that you guys support virtualization on the RadTreeView and am very happy with its performance.
The way I use it is:

telerikTreeView:TreeViewPanel.IsVirtualizing="True"
telerikTreeView:TreeViewPanel.VirtualizationMode="Recycling"

There are three modes for virtualization - "Recycling", "Standard" and "Hierarchical". I could find some description for first two. How does the "Hierarchical" perform?

Also I noticed that virtualization is not enabled by default. Are there any cases when virtualization should not be turned on? Do I need to worry about something when turning it on?

Thank you,
Ruben.
rubenhak
Top achievements
Rank 1
 answered on 20 Jul 2010
2 answers
213 views
Hi,

I set the following property for the DataGrid
_dataGrid.SelectionMode = _presenter.AllowMultipleSelection ? SelectionMode.Extended : SelectionMode.Single;

Value of _presenter.AllowMultipleSelection  is set to true for multiple selection. When I use Shift Key and Mouse I am able to select multiple rows but using Shift Key and Up/down keys i am not able to select multiple rows in a data grid view.

I looked at the documentation. In example its seems to work with selection mode extended. But when I am implementing for my grid it doesn't......

Regards
Sanket
Sanket Singhvi
Top achievements
Rank 1
 answered on 20 Jul 2010
1 answer
217 views
I am trying to add a display bellow my grid which will show how many of the source items are displayed in the grid after filtering is applied.  I have two text Blocks, one bound to ItemsSource.Count, this works fine and the other bound to Items.Count this always shows a value of 0.  Is binding to this property not possible?  Is there another way to accomplish this easily that will work across multiple methods of applying filters.
Maya
Telerik team
 answered on 20 Jul 2010
1 answer
97 views
Hello,

I'd like to catch the checked/unckecked item.

As you describe in your documentation : http://www.telerik.com/help/wpf/telerik.windows.controls.navigation-telerik.windows.controls.radtreeview-unchecked_ev.html

I've tried this :

void RadTreeView1_Unchecked(object sender, RadRoutedEventArgs e)
{
   // get a reference to the item that has been unchecked
   RadTreeViewItem uncheckedItem = e.Source as RadTreeViewItem;
        if (uncheckedItem == null) return;
        SphItem oItem = uncheckedItem.DataContext as SphItem;
        if (oItem != null && OnUncheckedItem != null) OnUncheckedItem(oItem);

}


But uncheckedItem is always null.

If I use e.Originalsource, i get a RadTreeViewItem, but not the leaf one.
image my tree is like this :
part1
  |--- elt1
  |--- elt2
I unchecked elt2, i obtain part1 in my datastructure SphItem...

Thanks for your help
Aurore
Valentin.Stoychev
Telerik team
 answered on 20 Jul 2010
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
Slider
Expander
TileList
PersistenceFramework
DataPager
TimeBar
Styling
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
CardView
DataBar
WebCam
FilePathPicker
Licensing
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Nakul
Top achievements
Rank 3
Iron
Iron
Iron
Rina
Top achievements
Rank 2
Iron
Iron
Mukesh
Top achievements
Rank 2
Iron
Iron
Iron
Ruksana
Top achievements
Rank 1
Rakesh
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Nakul
Top achievements
Rank 3
Iron
Iron
Iron
Rina
Top achievements
Rank 2
Iron
Iron
Mukesh
Top achievements
Rank 2
Iron
Iron
Iron
Ruksana
Top achievements
Rank 1
Rakesh
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?