Telerik Forums
UI for WPF Forum
1 answer
129 views

Dear Telerik Team!

I use custom appointment which inherits from EntityObject. What I want to achieve is to place a button on an appointment, so I placed following code on the custom appointment template:

<Button Grid.Column="0" Grid.Row="1" Content="{Binding Appointment.Approved}" Width="50" Height="50" prism:Click.CommandParameter="{Binding Appointment.Id}" prism:Click.Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.TaskApprovalCommand}" />

I'm able to click the button and execute its command, but when I change "Approved" property the UI is not updating. When I try to bind the content of the button to some other property, like "Subject" it is working fine. The problem is with custom properties, the ones which are not part of original appointment class. Could you please suggest some solution for that problem? I'd be very grateful.

Many thanks and best regards
Krzysztof Kaźmierczak

Yana
Telerik team
 answered on 19 Nov 2012
5 answers
174 views

Hi,

I'm using Telerik RadControls Q3 2012. After the update, I plan to add a Bollinger Band to a ChartView. However, after several trials, it always hangs the application by System.NullReferenceException: Object reference not set to an instance of an object.

The ChartView I'm using is a simple LineSeries chart in XAML:

<telerik:RadCartesianChart Margin="5" Grid.Column="0" x:Name="PriceChart" Padding="0,0,0,0">
                    <telerik:RadCartesianChart.HorizontalAxis>
                        <telerik:DateTimeContinuousAxis LabelFormat="d-MMM-yy"
                                                                MajorStep="1"
                                                                MajorStepUnit="Month"                                                               
                                                                GapLength="0.8"
                                                                PlotMode="OnTicks"                                                               
                                                                />
                    </telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:RadCartesianChart.VerticalAxis>
                        <telerik:LinearAxis BorderBrush="DimGray" BorderThickness="0.5" />
                    </telerik:RadCartesianChart.VerticalAxis>
                    <telerik:RadCartesianChart.Series>
                        <chartView:LineSeries ItemsSource="{Binding ChartData}"
                                              CategoryBinding="Date"
                                              ValueBinding="Price" 
                                              Stroke="Black"
                                              StrokeThickness="0.5"/>                       
                    </telerik:RadCartesianChart.Series>
                    <telerik:RadCartesianChart.Grid>
                        <telerik:CartesianChartGrid MajorLinesVisibility="Y"/>
                    </telerik:RadCartesianChart.Grid>
                </telerik:RadCartesianChart>




This is how I add the Bollinger Band to the chart:

 

LineSeries lineSeries = this.PriceChart.Series[0] as LineSeries;
                if ((lineSeries != null) && (lineSeries.ItemsSource != null))
                {
                    BollingerBandsIndicator indicator = new BollingerBandsIndicator();
                    indicator.Period = 5;
                    indicator.StandardDeviations = 2;
                    indicator.CategoryBinding = lineSeries.CategoryBinding;
                    indicator.ValueBinding = lineSeries.ValueBinding;
                    indicator.ItemsSource = lineSeries.ItemsSource;
 
                    indicator.Stroke = Brushes.Red;
                    indicator.LowerBandStroke = Brushes.Red;
                    indicator.StrokeThickness = 1;
 
                    this.PriceChart.Indicators.Add(indicator);
                }

 

 

 



And this is the StackTrace for the Exception caught:
  

at
Telerik.Windows.Controls.ChartView.BollingerBandsIndicatorDataSource.BindCore()
in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\Financial\BollingerBandsIndicatorDataSource.cs:line
63<BR>   at
Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.Bind() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line
235<BR>   at
Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.Rebind(Boolean
itemsSourceChanged, IEnumerable newSource) in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line
81<BR>   at
Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.set_ItemsSource(IEnumerable
value) in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\DataBinding\DataSources\ChartSeriesDataSource.cs:line
54<BR>   at
Telerik.Windows.Controls.ChartView.ChartSeries.InitDataBinding() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.cs:line
316<BR>   at
Telerik.Windows.Controls.ChartView.IndicatorBase.InitDataBinding() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Indicators\IndicatorBase.cs:line
94<BR>   at
Telerik.Windows.Controls.ChartView.ValueIndicatorBase.InitDataBinding() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Indicators\ValueIndicatorBase.cs:line
50<BR>   at
Telerik.Windows.Controls.ChartView.ChartSeries.OnApplyTemplate() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\ChartSeries.cs:line
239<BR>   at
Telerik.Windows.Controls.ChartView.LineIndicatorBase.OnApplyTemplate() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Indicators\LineIndicatorBase.cs:line
112<BR>   at
Telerik.Windows.Controls.ChartView.BollingerBandsIndicator.OnApplyTemplate() in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\Indicators\BollingerBandsIndicator.cs:line
125<BR>   at
System.Windows.FrameworkElement.ApplyTemplate()<BR>   at
Telerik.Windows.Controls.ChartView.RadChartBase.OnPresenterAdded(ChartElementPresenter
presenter) in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\RadChartBase.cs:line
405<BR>   at
Telerik.Windows.Controls.ChartView.PresenterCollection`1.InsertItem(Int32 index,
T item) in
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\PresenterCollection.cs:line
34<BR>   at
STA.Modules.MarketData.Views.PairAnalytics.PairAnalyticsDetailPairView.<PostQueryChartData>b__0()
in C:\Segantii\Development\Source Control\Projects\Odin\trunk\Source
Codes\SegantiiTradingAnalytics\STA.Modules.MarketData\Views\PairAnalytics\PairAnalyticsDetailPairView.xaml.cs:line
70<BR>   at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,
Object args, Int32 numArgs)<BR>   at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate
method, Object args, Int32 numArgs, Delegate catchHandler)<BR>   at
System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object
args, Int32 numArgs, Delegate catchHandler)<BR>   at
System.Windows.Threading.DispatcherOperation.InvokeImpl()<BR>   at
System.Threading.ExecutionContext.runTryCode(Object userData)<BR>   at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)<BR>   at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean ignoreSyncCtx)<BR>  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)<BR>   at
System.Windows.Threading.DispatcherOperation.Invoke()<BR>   at
System.Windows.Threading.Dispatcher.ProcessQueue()<BR>   at
System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr
wParam, IntPtr lParam, Boolean& handled)<BR>   at
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr
lParam, Boolean& handled)<BR>   at
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)<BR>   at
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,
Object args, Int32 numArgs)<BR>   at
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate
method, Object args, Int32 numArgs, Delegate catchHandler)<BR>   at
System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object
args, Int32 numArgs, Delegate catchHandler)<BR>   at
System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority,
TimeSpan timeout, Delegate method, Object args, Int32 numArgs)<BR>  
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam,
IntPtr lParam)<BR>   at
MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)<BR>   at
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame
frame)<BR>   at System.Windows.Application.RunInternal(Window
window)<BR>   at System.Windows.Application.Run()<BR>   at
SegantiiTradingAnalytics.App.Main() in C:\Segantii\Development\Source
Control\Projects\Odin\trunk\Source
Codes\SegantiiTradingAnalytics\SegantiiTradingAnalytics\obj\x86\Debug\App.g.cs:line
0<BR>   at System.AppDomain._nExecuteAssembly(RuntimeAssembly
assembly, String[] args)<BR>   at
System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext
activationContext, String[] activationCustomData)<BR>   at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()<BR>  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean ignoreSyncCtx)<BR>  
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)<BR>   at
System.Threading.ThreadHelper.ThreadStart()

Any help will be welcome.
Many thanks!

Frankie


Petar Marchev
Telerik team
 answered on 19 Nov 2012
2 answers
135 views
Hi!

I've tried to add a custom function to the functions list and haven'd found any way to do it. In Win Forms, this is possible by extending
Telerik.Data.Expressions.ExpressionContext
class. However, in WPF i haven't found any similar class.
Can you help, please?
Alex
Alexandru
Top achievements
Rank 1
 answered on 19 Nov 2012
7 answers
966 views
In my grid I have a custom collection filter that I created using this blog post: http://blogs.telerik.com/xamlteam/posts/11-12-05/filtering-collection-properties-with-radgridview-for-silverlight-and-wpf.aspx .

I'm currently adding persistence to my grid and running into issues saving/restoring my custom filter. It seems that I need to implement IColumnFilterDescriptor to properly reflect UI changes when I set my filter programmatically upon restoring a persisted grid. However (as in the above demo) my custom filter descriptor only implements IFilterDescriptor. Could you provide some information on how I can implement my own filter descriptor and also be able to persist it?

Thanks.
Rossen Hristov
Telerik team
 answered on 19 Nov 2012
0 answers
68 views
Hi,
As you know when we add a FilterDescriptors to a RadDataFilter it select IsEqualTo as default item for search.
i want to always show Contains as a default when select a string variable.
How i can do it?

Best Regards.
Mojtaba Madadkhani
Top achievements
Rank 1
 asked on 17 Nov 2012
1 answer
161 views
Hello,
Please help me with this error. In my application, i put a RadGridView inside a Scrollviewer as showed the code block below. When i run this application each column becomes so wide, their widths are 10000px, equal to their MaxWidth althrougth i do not set any columns' MaxWidth:
<Window x:Class="GridViewTest.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
    <ScrollViewer telerik:StyleManager.Theme="Metro" HorizontalScrollBarVisibility="Auto">
        <telerik:RadGridView AutoGenerateColumns="False" ShowGroupPanel="False" ShowInsertRow="False" IsReadOnly="True" RowIndicatorVisibility="Collapsed" Name="grdItems">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Header1" Width="50*" MinWidth="50" />
                <telerik:GridViewDataColumn Header="Header2" Width="25*" MinWidth="50" TextAlignment="Right" />
                <telerik:GridViewDataColumn Header="Header3" Width="25*" MinWidth="50" />
            </telerik:RadGridView.Columns>           
        </telerik:RadGridView>       
    </ScrollViewer>    
</Window>

What i really want is that the horizontal scrollbar apprears when the main window is not maximize and disappears when the main window is maximize.
Stephan
Top achievements
Rank 1
 answered on 17 Nov 2012
1 answer
234 views
How can i determined?
For example: When i change layout mode flow to paged the distance changing the document ruler and the raddocument.
I would like copy drag from listbox to document some text.Quote of the mouse position, and set the caret position, when drop completed.
When layout mode flow, allright, but paged mode not good.
Petya
Telerik team
 answered on 16 Nov 2012
1 answer
142 views
I'm trying to figure out some way to obtain a layout similar to the following:


| item0                    |
| item1                    |
| item2                    |
| i3 || i4 || i5 || i6 || i7 |

That is, multiple tiles that are maximized along the top 3 rows, but the bottom row contains minimized version of the rest of the items. The idea is also to have this work such that the number of row available corresponds to the available height of the control.

Is there anyway to accomplish this with the RadTileView?
Pavel R. Pavlov
Telerik team
 answered on 16 Nov 2012
1 answer
239 views
Is there a way to make the default RadDocking status to Tabbed document?
When we right click the docking pane, there are "Floating, Dockable, Tabbed Document, Auto hide, Hide" options. But I don't knew which property does this change? How to make it to "Tabbed Document" by default?


Thanks.
Boyan
Telerik team
 answered on 16 Nov 2012
5 answers
90 views
I am grabbing an RTF document via a web service.  That result is a string (the sRTF variable).  Code to import this into the editor is as follows:

// Convert to a byte array with the proper encoding
byte[] byteArray = Encoding.ASCII.GetBytes(sRTF);
// Then import into the document
IDocumentFormatProvider formatProvider = DocumentFormatProvidersManager.GetProviderByExtension(".rtf");
editor.Document = formatProvider.Import(byteArray);


Although this works, and I see my document show up correctly, about a half second later the application blows up with the attached error.  I included this as an image to show call stack and other info.  Any ideas anyone?
Petya
Telerik team
 answered on 16 Nov 2012
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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?