Telerik Forums
UI for WPF Forum
6 answers
382 views
Hi

I'm looking for an example of binding an observable collection to a radChart in xaml.

This is an app i'm playing around with and it supplies its data to the view using the MVVM pattern.  For the life of me i cannot find an example of how to do this.  Any example i come across has data hard coded into the xaml which i find really annoying - why not use northwind/adventureworks to show these examples?

I have a observable collection with products and quantities all i want to do is show the quantities for each product on a chart.  This will work if i just bind the itemsource of the chart to the observable collection.  but i want to show the product name along the x-axis and also in the legend.

Can anyone give me an example?

Nice controls by the way - just finding it hard to find info in how to use them in MVVM app.

It would be nice if you could have examples that pulled data from a database i.e. Nortwind/adventureworks this would surely help a lot of beginners like myself.

Thanks
Paul 




Dwight
Telerik team
 answered on 03 Nov 2009
3 answers
109 views
When I look at all of the WPF examples I see the XAML pages, but when i click to see C# pages nothing happens... Both in
IE 8.0.6001.18828
and
Firefox
3.0.8

Thanks !
Milan
Telerik team
 answered on 03 Nov 2009
9 answers
242 views
Hi,

Is there any way to bind to the CheckState of an Item in the TreeView?

Cheers

Justin Taylor
Tihomir Petkov
Telerik team
 answered on 02 Nov 2009
1 answer
325 views
is there a way to remove the scroll bars on a combox dropdown.  I just want the dropdown to be large enough for all the items.  I only have 1 or 2 too many items, and would rather have a larger dropdown then have scroll bars
Valeri Hristov
Telerik team
 answered on 02 Nov 2009
3 answers
286 views
Hi,

I would like to do some basic customizations to the Telerik GridView. I am using the Office_Silver theme  

1. Remove all gridlines from the Telerik GridView - including the column headers

2. Set the highlight color for the row

3. Customize the alternating background color
          Already done using the AlternateRowStyle property on RadGridView

Can someone please advise me how I can make these customizations

Thanks
Namir


            
Kalin Milanov
Telerik team
 answered on 02 Nov 2009
5 answers
276 views
Hi.
I have TreeView like:
A
  AA
  AA
B
  BB
  BB
C
  CC
  ...
Drag/drop is only allowed inside of its group. Ex: AA can be moved anywhere inside A group, BB can be moved anywhere inside B group. Initialy i was stopping drop using previewDragEnded. It worked only in situations when drop position was "inside". If drop position was "after" or "before" RadTreeViewDragEndedEventArgs e.TargetDropItem was always null even though if I check TreeView.TargetDropItem was set correctly (I guess it is a bug? ). I couldnt check it cause TreeView.TargetDropItem is not accesible from code.
My current approach is traverse the tree and set IsDropAllowed property on every item. The problem here are elements whose drop position is "after" or "before" which I try to drop after or before root elements (A, B, C). These root elements doesn't have parent elemnent so I don't see any way to set there IsDropAllowed . So behaviour I have now is: after I drag AA after B I got:
B
   BB
   BB
   AA
I thought about adding additional root element and add current root elements to him but in this case I would have to hide (don't display) the new root element otherwise I would have the same problem as before.

Any help or suggestions would be appreciated.

Best Regards,
Jarek (Xiasma)


Bobi
Telerik team
 answered on 30 Oct 2009
2 answers
476 views
I am trying to wire-up a click event to a checkbox column inside the RadGridview.  My problem is that when I handle the click event of the check box the grid has not registered the selected item yet, so I can't access the record to obtain the value from another column for the record which was checked.  Here is the click event code:

        private void CheckBox_Click(object sender, RoutedEventArgs e)  
        {  
            CheckBox chkbox = (CheckBox)sender;  
            ApplyPaymentEntity payment = new ApplyPaymentEntity();  
            payment = (ApplyPaymentEntity)this.grdPmtDetail.SelectedItem;  
 
            if (chkbox.IsChecked == true)  
            {  
                AppliedAmount = AppliedAmount + (decimal)payment.BillBalance;  
            }  
            else  
            {  
                AppliedAmount = AppliedAmount - (decimal)payment.BillBalance;  
            }  
  
        }  

The SelectedItem property is null.  So I need to handle the click event after the grid has processed the click.  Just not quite sure yet how to do this.

Thanks,
-SId.
Sid
Top achievements
Rank 1
 answered on 30 Oct 2009
1 answer
146 views
I have discovered a GridViewComboBoxColumn, NullReferenceException that is reproducible with the Examples_WPF application. Using the GridView Editors example, if you drop down the country combo box, then select another row and try to drop down the country list, a NullReferenceException is thrown. The exception is thrown even if you try to drop down the list in the same row that you started with. I am trying to use the GridViewComboBoxColumn in my app in a similar way that the example shows and am having the same problem. I am using the latest internal build (2009.2.1023.35). The Telerik.com online demo does the same thing.

Thanks,
Kevin
Pavel Pavlov
Telerik team
 answered on 30 Oct 2009
1 answer
140 views
I have RadTabcontrol and whenever user click on New button I want to add new tab containing usercontrol everytime.I have successfully achieved this at run time but due to some Performance issue I want to achieve this in xaml
I tried:
 <Setter Property="telerikNavigation:RadTabControl.ItemContainerStyle">
                                        <Setter.Value>
                                            <Style TargetType="telerikNavigation:RadTabItem">
                                                <Setter Property="Foreground" Value="Black"/>
                                                <Setter Property="FontFamily" Value="Tahoma"/>
                                                <Setter Property="BorderThickness" Value="0"/>
                                                <Setter Property="BorderBrush" Value="Transparent"/>
                                                <!--<Setter Property="Content" >
                                                    <Setter.Value>
                                                        <ctrl:ctrlReview  x:Name="Uctrl" REVKEY="{Binding Source={StaticResource RevKeyProvider}}">
                                                        </ctrl:ctrlReview>
                                                    </Setter.Value>
                                                 </Setter>-->


while setting value for property content,It giving me error:Cannot add content of type 'SafetyAuditUserControl.ctrlReview' to an object of type 'System.Object'.

Please help

Bobi
Telerik team
 answered on 30 Oct 2009
1 answer
147 views
Hi ,im facing strange problem  , project compiles successfully,app works fine to, but designer window shows error , i dunno whats the "type: Customer" it doesnt exits in my project
thanks
itemsource provider is EntityFramework
<telerik:RadGridView.Columns>
              
  <telerik:GridViewDataColumn Header="Cost" DataMemberBinding="{Binding Cost}"  DataType="{x:Type System:Double}" >
                    <grid:GridViewDataColumn.AggregateFunctions>
                        <data:SumFunction Caption="Sumا "  SourceField="Cost" />
                    </grid:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>

</telerik:RadGridView.Columns>



Error:
Invalid property or field - 'Cost' for type: Customer
   at Telerik.Windows.Data.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\MemberAccess\Tokenizer\MemberAccessTokenExtensions.cs:line 21
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\ExpressionFactory.cs:line 32
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\ExpressionFactory.cs:line 42
   at Telerik.Windows.Data.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\MemberAccess\PropertyAccessExpressionBuilder.cs:line 15
   at Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateMemberSelectorExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\Aggregates\EnumerableSelectorAggregateFunctionExpressionBuilder.cs:line 37
   at Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateAggregateExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\Aggregates\EnumerableSelectorAggregateFunctionExpressionBuilder.cs:line 28
   at Telerik.Windows.Data.EnumerableSelectorAggregateFunction.CreateAggregateExpression(Expression enumerableExpression) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Data\Grouping\Aggregates\EnumerableSelectorAggregateFunction.cs:line 22
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.<ProjectionPropertyValueExpressions>b__3(AggregateFunction f) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 212
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 203
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 195
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.<CreateMemberBindings>d__0.MoveNext() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 113
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Linq.Expressions.ReadOnlyCollectionExtensions.ToReadOnlyCollection[T](IEnumerable`1 sequence)
   at System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 105
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 97
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilderBase.cs:line 30
   at Telerik.Windows.Data.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Collections\QueryableExtensions.cs:line 92
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates() in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 3066
   at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass3c.<Bind>b__3b() in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 3345
   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Controls\CursorManager.cs:line 16
   at Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(Object newValue) in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 3271
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsSourceChanged(Object oldValue, Object newValue) in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 2946
   at Telerik.Windows.Controls.DataControl.OnItemsSourcePropertyChanged(DependencyObject origin, DependencyPropertyChangedEventArgs args) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\DataControl.cs:line 361
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.DataControl.set_ItemsSource(Object value) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\DataControl.cs:line 149
   at Telerik.Windows.Controls.RadGridView.OnApplyTemplate() in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\RadGridView.cs:line 226
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.SimpleViewManager.DesignerBackground.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize()
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content)
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle()
   at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Stefan Dobrev
Telerik team
 answered on 30 Oct 2009
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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?