Telerik Forums
UI for WPF Forum
1 answer
231 views
I am trying to implement a chartview with a line series. The x axis has values in miliseconds. I feel the features of the linear axis suites me more then the DateTimeCategoricalAxis but I can't seem to get it to work with linear axis in both horizontal and vertical directions. Doesn't this work? And if it does, how would I do thìs? Is there any example showing this?    
Peshito
Telerik team
 answered on 06 Mar 2012
3 answers
216 views
Hi

i am creating readonly ranges using the InsertReadOnlyRange method.
This works well most of the times.
However I get a NullReferenceException deeply from the tk-lib code
with the following stacktrace:

    
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Model.RadDocument.GetCaretInline() Line 1319    C#
     Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Model.RadDocument.GetCurrentSpanStyle() Line 1336 + 0xc bytes    C#
     Telerik.Windows.Documents.dll!Telerik.Windows.Controls.RadRichTextBox.UpdateCurrentStyles() Line 2974 + 0x20 bytes    C#
     Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.DoOnCaretLocationChanged() Line 441    C#
    Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.DoOnDocumentChanged.AnonymousMethod__6() Line 409 + 0xa bytes    C#

the line raising the exception goes like:

//Line 1319 in RadDocument.cs
    SpanLayoutBox previousSpanBox = DocumentStructureCollection.GetPreviousSiblingForDocumentElement(currentSpanBox,
                    currentSpanBox.Parent.AssociatedDocumentElement) as SpanLayoutBox;
                              //  ^^^^^NullReferenceException: Parent is null sometimes

"Parent" is null here.
I noticed that the "null-ness" and the exception only occur if the span is inserted using InsertInline:

RadDocument doc = editor.Document;
 var span1 = new Span("This text is protected");
// doc.InsertInline(span1); //this span's spanbox will have no Parent, causing a Null ref
 (doc.Sections.Last.Blocks.Last as Paragraph).Inlines.Add(span1); //this span's spanbox will have a Parent, not causing a Null ref
 DocumentPosition pos3 = new DocumentPosition(doc.DocumentLayoutBox, true);
 var spb1 = span1.FirstLayoutBox as SpanLayoutBox;
 pos3.MoveToInline(spb1, 0);
 
 DocumentPosition pos4 = new DocumentPosition(doc.DocumentLayoutBox, true);
 pos4.MoveToInline(spb1, spb1.PositionsCountInBox - 1);
 
 doc.InsertReadOnlyRange(pos3, pos4); // raises Null ref in RadDocument.GetCaretInline if using "doc.InsertInline"


so my wish to the telerik developpers is to fix this line of code.
There are circumstances where a spanbox has no Parent layoutbox.
(E.g. when appending it with InsertInline). So you can't use it to get its previous sibling.
If you anaylze the stack trace and the surrounding code of "GetCaretInline"
it's fully OK to null check the Parent property and in this case simply return
the span associated to the layoutbox "currentSpanBox".

Chris
Iva Toteva
Telerik team
 answered on 06 Mar 2012
0 answers
124 views
Hi,

I am using a TreeListView to display data as multi-column tree. I have set my VM as DataContext to the page and giving my VM property as the ItemsSource of the TreeListView control. When I change the underlying data in VM, it updates the data in the grid normally for the 1st time, but it never updates the data in the grid after that. I checked the data in VM is always right, but the grid never shows the update. It happens only once.

My grid code is:
<telerik:RadTreeListView x:Name="trvHierachyData" ItemsSource="{Binding Path=Data}">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}">
                    <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}">
                        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}">
                            <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}">
                                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}">
                                </telerik:TreeListViewTableDefinition>
                            </telerik:TreeListViewTableDefinition>
                        </telerik:TreeListViewTableDefinition>
                    </telerik:TreeListViewTableDefinition>
                </telerik:TreeListViewTableDefinition>
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>


I am setting the page data context to the VM, i.e. in page ctor - this.DataContext = vmMainControl. The VM has a property by the name of Data which is of type ObservableCollection<T>. The Data collection has Items which is a collection collection of that node.

Please let me know if I am not clear

Regards,
Bhaskar
Bhaskar Khaund
Top achievements
Rank 1
 asked on 06 Mar 2012
1 answer
45 views

When the view is initially loaded, the RadPanes start out open, and then immediately shut. This is visible and distracting. I really want them to just be closed from the get go.How can I make it so the RadPanes in a RadPaneGroup are initially closed (unpinned)?

How can I make it so the RadPanes in a RadPaneGroup are initially closed (unpinned)?

Code snipet:

<radDock:RadDocking x:Name="radDocking1" Background="{StaticResource WindowBackgroundBrush}">
<radDock:RadDocking.DocumentHost>
<!-- controls here -->
</radDock:RadDocking.DocumentHost>
<radDock:RadSplitContainer radDock:DockingPanel.InitialSize="300,300" MaxWidth="600"
Name="RightContainer" InitialPosition="DockedRight">
<radDock:RadPaneGroup x:Name="_librariesGroup">
<radDock:RadPane x:Name="_requirementsLibraryPane" Header="Requirements Library"
CanFloat="False" CanUserClose="False" CanUserPin="True" IsPinned="False">
<my1:RequirementsLibraryDrawerControl x:Name="_requirementsLibraryDrawer" />
</radDock:RadPane>
 
 
 
</radDock:RadPaneGroup>
</radDock:RadSplitContainer>
</radDock:RadDocking>


Georgi
Telerik team
 answered on 06 Mar 2012
3 answers
217 views
hi there,

    how to i load multiple items in multiple panel bar so that it show dynamic world like we can a panel bar and behind the code it generates multiple panel bar ann each panel bar contains multiple items and all these panel bars are loaded dynamically???
Usman
Top achievements
Rank 1
 answered on 06 Mar 2012
0 answers
139 views

I am trying to implement a ContextMenu for a treeview control (WPF) by using your Telerik's online tutorial. However, I often get error message as I copy & paste the tutorial code.

Here is what I have in XAML:
        <telerik:RadTreeView Canvas.Left="18" Canvas.Top="136" Height="615" Name="raceTreeView" Width="311" Background="Bisque" IsLineEnabled="True">
            <!-- This code segement implements a popup menu on the treeview.-->
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu ItemClick="TreeContextMenu_ItemClick">
                    <telerik:RadMenuItem Header="Add" />
                    <telerik:RadMenuItem Header="Delete" />
                    <telerik:RadMenuItem Header="Edit" />
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
        </telerik:RadTreeView>

Here is the relevant segements in C# code-behind:
using Telerik.Windows;
using Telerik.Windows.Controls;
using Telerik.Windows.Data;

....

private void TreeContextMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
   {
    MenuItem item = (e.OriginalSource as RadMenuItem).DataContext as MenuItem;
    switch ( item.Text )
    {
        case "Add":
            ....
        case "Edit":
            ....
        case "Delete":
            ....
        }
     }
   }

I get an error message on this line : switch ( item.Text )
'System.Windows.Controls.MenuItem' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type 'System.Windows.Controls.MenuItem' could be found (are you missing a using directive or an assembly reference?)

How can I solve this problem?

Thanks,
Hamid

Please disregard this post. I found the error.
Thanks,
Hamid

Hamid
Top achievements
Rank 1
 asked on 06 Mar 2012
2 answers
129 views
Hello.

I am new to Telerik. I need to populate a treeview with data from an Oracle DataReader (using ODP.NET which is an implementation of ADO.NET). Is there a step by step guide on this subject that I could use (XAML and C# code)?

Thanks,
Hamid
Hamid
Top achievements
Rank 1
 answered on 05 Mar 2012
4 answers
210 views

I have a data bound column on a float field.  Some of the float values are null in the database.  When I filter on the column when all values are not null, the filter works fine.  When I filter on the column with null values included, I get an exception in Telerik code, "Nullable object must have a value."  Here is the call stack when the exception is thrown:
:

  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableExtensions.Count(System.Linq.IQueryable source) Line 399 + 0x18b bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.GetPagingDeterminativeItemCount() Line 413 + 0x86 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.PagingDeterminativeItemCount.get() Line 405 + 0x14 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.GetEffectiveItemCount() Line 388 + 0xa bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.UpdateItemCount() Line 381 + 0x1e bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.OnInternalListCreated() Line 783 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.EnsureInternalList() Line 643 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.InternalList.get() Line 632 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.InternalCount.get() Line 319 + 0x17 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.IsEmpty.get() Line 277 + 0x14 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.IsEmpty.get() Line 355 + 0x21 bytes C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.BaseItemsControl.OnItemCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 690 + 0x66 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 636 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 615 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 1050 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.WeakEvent.WeakListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.Handler(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Line 33 + 0x69 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Line 875 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.RefreshOverride() Line 1022 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.RefreshInternal() Line 970 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer() Line 965 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh() Line 438 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 473 C#
  [External Code]
  Telerik.Windows.Data.dll!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Data.IFilterDescriptor>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 149 + 0xf bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.ObservableItemCollection<Telerik.Windows.Data.IFilterDescriptor>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 93 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Data.IFilterDescriptor>.InsertItem(int index, Telerik.Windows.Data.IFilterDescriptor item) Line 196 C#
  [External Code]
  Telerik.Windows.Data.dll!Telerik.Windows.Data.CollectionHelper.Insert(System.Collections.IList target, System.Collections.IEnumerable newItems, int startingIndex, System.Collections.IEqualityComparer itemComparer) Line 334 + 0x44 bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(System.Collections.IList sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Line 106 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Line 87 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.WeakEvent.WeakListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.Handler(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args) Line 33 + 0x69 bytes C#
  [External Code]
  Telerik.Windows.Data.dll!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Data.IFilterDescriptor>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 149 + 0xf bytes C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.ObservableItemCollection<Telerik.Windows.Data.IFilterDescriptor>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) Line 93 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Data.IFilterDescriptor>.InsertItem(int index, Telerik.Windows.Data.IFilterDescriptor item) Line 196 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FilteringViewModel.OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) Line 551 + 0x3b bytes C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ViewModelBase.OnPropertyChanged(string propertyName) Line 58 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FilteringViewModel.ApplyFilters() Line 459 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FilteringViewModel.OnFieldFilterPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) Line 386 C#
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ViewModelBase.OnPropertyChanged(string propertyName) Line 58 C#
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FilterDescriptorViewModel.Value.set(object value) Line 103 C#
  [External Code]
  Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadMaskedTextBox.Value.set(object value) Line 376 C#
  Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadMaskedTextBox.UpdateValueFromHandler() Line 1444 C#
  Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadMaskedTextBox.TextBox_LostFocus() Line 877 + 0xd bytes C#
  Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.MaskedTextBox.ExtendedTextBox.OnLostFocus(System.Windows.RoutedEventArgs e) Line 53 C#
  [External Code]






Bob
Top achievements
Rank 3
Iron
Iron
Veteran
 answered on 05 Mar 2012
4 answers
222 views

I am in the process of evaluating Telerik controls for WPF.  I started by added a RadTabControl
to my main window (window1).  I then set up 3 RadTabItems by using the collection editor
under the Items property of the RadTabControl.  Dragging other controls from the toolbox
over to specific RadTabItems doesn't appear to work.  I manually went into the XAML code
and inserted a calendar control on RadTabItem(2), and it shows up when running the
program, it does not show when in design mode however.  I'm further confused by how
you would go about adding multiple controls to a RadTabItem.   I am currently using
Visual Studio 2008 Version 9.0.21022.8 .Net Framework 3.5.  Here is my current
XAML code.  I'm wondering if someone could give me some pointers on what I'm
doing wrong ?

<Window x:Class="Window1"
    Title="Window1" Height="300" Width="708" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid>
        <telerik:RadTabControl Margin="39,51,94,45" Name="RadTabControl1" TabOrientation="Vertical" TabStripPlacement="Left">
            <telerik:RadTabItem AllowDrop="True" Header="Tab1" Name="RTI1"></telerik:RadTabItem>
            <telerik:RadTabItem AllowDrop="True" Header="Tab2" Name="RTI2">
                <telerik:RadCalendar Name="RadCalendar1" HorizontalAlignment="Left" Width="121" ClipToBounds="True" telerik:StyleManager.Theme="Metro"></telerik:RadCalendar>
            </telerik:RadTabItem>
            <telerik:RadTabItem AllowDrop="True" Header="Tab3" Name="RTI3"></telerik:RadTabItem>
        </telerik:RadTabControl>
    </Grid>
</Window>

Dan
Top achievements
Rank 1
 answered on 05 Mar 2012
9 answers
136 views
How can I display checkbox on group header using SelectColumn?

I would like to select all rows within group with one checkbox.
Mike
Top achievements
Rank 1
 answered on 05 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?