Telerik Forums
UI for WPF Forum
5 answers
168 views

Hello,

 I'm trying to get the RadContextMenu attached to the RadScheduleView to open at the currently selected slot, appointment or empty field using the Apps key (a.k.a. keyboard rightclick).

 

So far I've tried changing the PlacementTarget ​in the RadContextMenu's OnOpening event, but I can't find a way to get the actual source.

RadContextMenu.elementCausedContextMenuOpen is TimeLineRulerPanel, hence RadContextMenu.GetClickedElement<AppointmentItem>() returns null.

Placing the RadContextMenu at MousePoint is not an alternative as it could be anywhere within the application.

 

So is it event possible to get the current scheduler child control to place the ContextMenu at?

 

Thanks in advance!

Jochen

Jochen
Top achievements
Rank 1
 answered on 18 Aug 2015
1 answer
81 views

My ItemsSource is a list of records with a Properties bag, rather than having convenient top-level properties

Attempts to define the relationship like this do not work (see error below). Is there some other mechanism?

      var p = new FieldDescriptorNamePair
      {
        ParentFieldDescriptorName = "Properties[\"OrderId\"].Value",
        ChildFieldDescriptorName  = "Properties[\"ParentOrderId\"].Value"
      };

 

----------------------------------------------------------------------------------

  Object reference not set to an instance of an object.
--- Stack Trace
   at Telerik.Windows.Data.HierarchyFilter`1.<>c__DisplayClass6.<CreateFilterLambda>b__4(TElement r1)
   at Telerik.Windows.Data.HierarchyFilter`1.CompareValues(TElement record)
   at Telerik.Windows.Data.HierarchyFilter`1.<FilteredData>b__8(TElement d)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()

Stefan
Telerik team
 answered on 18 Aug 2015
0 answers
111 views
How can I make a method to execute when a menu item is clicked for example run a method that shows the header of the item that was clicked
Mazen
Top achievements
Rank 1
 asked on 18 Aug 2015
1 answer
181 views

With Q2 2015 SP1 data binding ObservableCollection of a simple POCO class speed is about 25,000 per minute. Is this normal or should it be faster? It feels very slow...

With stopwatches I established that the database operation, object creation and adding to ObservableCollection takes under one second so there is no bottleneck there, it's the data binding that is slow.

The grid does display the collection items quickly and is responsive but only a subset of the items is shown and it keeps loading items and DataLoaded event keeps getting fired for each item in the collection but not as the item is added to the Observable collection, at that point the ObservableCollection is already fully populated it is firing for each item as data binding occurs apparently.

I am using ICollectionView and binding to that instead of binding directly to ObservableCollection which is speeding up the things considerably as it gets even slower when I bind directly to ObservableCollection.

As for performance degradation factors listed at http://docs.telerik.com/devtools/silverlight/controls/radgridview/troubleshooting/performance.html I do use RowStyle because I need a fixed height row and RowHeight property of the RadGridView itself is apparently only a hint because the row height gets bigger depending on the content unless MaxHeight row property is used which can't be set on the RadGridView itself and that was the only way to set the row background to transparent.

<Style x:Key="FixedHeightRgvRow" TargetType="t:GridViewRow" BasedOn={StaticResource GridViewRowStyle}">  

    <Setter Property="Background" Value="Transparent"/>    

   <Setter Property="Height" Value="24"/>    

<Setter Property="MaxHeight" Value="24"/>  </Style>

 However, even if I don't use that style the speed is the same.

 My POCO class:

 public class Log {     public int Id { get; private set; }     public DateTime Date { get; private set; }             public string ThreadName { get; private set; }     public string Level { get; private set; }     public string Logger { get; private set; }     public string Message { get; private set; }             public string Exception { get; private set; }     public Log(int id, DateTime date, string tName, string level, string logger, string msg, string ex)     {         Id = id;         Date = date;         ThreadName = tName;         Level = level;         Logger = logger;         Message = msg;         Exception = ex;     } }

 So, it's just a simple POCO class, no property change notification or anything like that...

Please advise...

Stefan
Telerik team
 answered on 17 Aug 2015
6 answers
167 views

Hi,

 we are using c# and TelerikRadControls for wpf. Now we try to create a BarcodeDesigner by using "RichTextBox" + RadBarcode39 + MailMerge.
Is it possible to merge the value of the RadBarcode on a RichTextBox?

 

Thanks a lot

Best Regards
Rene

Petya
Telerik team
 answered on 17 Aug 2015
7 answers
400 views
Hi,

We develop engineering software tools which means we must support values to varying degrees of accuracy.

For input from the user we are using the RadNumericUpDown control and set the NumberOfDecimalDigits property to the required precision. This works great however, for example if we set the precision to 10dp, the control displays 0.000000000 for a value of "0".

How can we change the control to display the value up the the significant digit rather than the maximum precision specified on the control?

To further clarify:

with a max of 10dp precision allowed if the user enters "1.1234" the value in the text box is 1.1234000000. However the user just wants to see 1.1234 without the trailing zeros.

Regards
Geri
Telerik team
 answered on 17 Aug 2015
1 answer
307 views
Hi everyone,

I'm having some trouble setting the data context property of my ContentTemplate within my RadTabControl (a tab control by Telerik). Here is my XAML:

    <telerik:RadTabControl Grid.Row="1" TabOrientation="Horizontal" ItemsSource="{Binding Counterparties}">
            <telerik:RadTabControl.ContentTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <!--<telerik:RadGridView Grid.Row="0" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ConsolidatedPositions}" Name="ExposureView" VerticalAlignment="Stretch" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" IsTabStop="False" RowHeight="18" SelectionMode="Extended" SelectionUnit="Mixed" IsReadOnly="True" ShowGroupPanel="False" ColumnWidth="75" GroupRenderMode="Flat" CanUserSortGroups="False" CanUserSortColumns="True" FontSize="11" RowIndicatorVisibility="Collapsed">-->
                        <telerik:RadGridView Grid.Row="0" ItemsSource="{Binding Path=DataContext.ConsolidatedPositions}" Name="ExposureView" VerticalAlignment="Stretch" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" IsTabStop="False" RowHeight="18" SelectionMode="Extended" SelectionUnit="Mixed" IsReadOnly="True" ShowGroupPanel="False" ColumnWidth="75" GroupRenderMode="Flat" CanUserSortGroups="False" CanUserSortColumns="True" FontSize="11" RowIndicatorVisibility="Collapsed">
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn Header="Cusip" DataMemberBinding="{Binding Path=Cusip, Mode=OneWay}"/>
                                <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Path=Description, Mode=OneWay}" Width="150" />
                                <telerik:GridViewDataColumn Header="Par Net" DataMemberBinding="{Binding Path=ParNet, Mode=OneWay}" DataFormatString="N0" TextAlignment="Right" Width="100" CellStyleSelector="{StaticResource ParNetStyleSelector}"/>
                                <telerik:GridViewDataColumn Header="Dirty Price" DataMemberBinding="{Binding Path=Price, Mode=OneWay}" Width="80" DataFormatString="F3" TextAlignment="Right"/>
                                <telerik:GridViewDataColumn Header="Settled Position" DataMemberBinding="{Binding Path=SettledPosition, Mode=OneWay}" DataFormatString="N0" TextAlignment="Right" Width="105" CellStyleSelector="{StaticResource SettledPositionStyleSelector}"/>
                                <telerik:GridViewDataColumn Header="Repos/Reverse" DataMemberBinding="{Binding Path=Repos, Mode=OneWay}" DataFormatString="N0" TextAlignment="Right" Width="90" CellStyleSelector="{StaticResource ReposStyleSelector}" />
                                <telerik:GridViewDataColumn Header="Clean Market Net" DataMemberBinding="{Binding Path=CleanMarketNet, Mode=OneWay}" TextAlignment="Right" DataFormatString="N0" Width="120" CellStyleSelector="{StaticResource CleanMarketNetStyleSelector}" />
                                <telerik:GridViewDataColumn Header="Borrows/Lent" DataMemberBinding="{Binding Path=TotalBorrows, Mode=OneWay}" TextAlignment="Right" DataFormatString="N0" Width="100" CellStyleSelector="{StaticResource TotalBorrowStyleSelector}"/>
                                <telerik:GridViewDataColumn Header="Pledge In/Out" DataMemberBinding="{Binding Path=TotalPledges, Mode=OneWay}" Width="100" TextAlignment="Right" DataFormatString="N0" CellStyleSelector="{StaticResource TotalPledgesStyleSelector}"/>
                                <telerik:GridViewDataColumn Header="T+1 Net Pos" DataMemberBinding="{Binding Path=FutureNet1, Mode=OneWay}" Width="90" TextAlignment="Right" DataFormatString="N0" CellStyleSelector="{StaticResource FutureNet1StyleSelector}"/>
                                <telerik:GridViewDataColumn Header="T+2 Net Pos" DataMemberBinding="{Binding Path=FutureNet2, Mode=OneWay}" Width="90" TextAlignment="Right" DataFormatString="N0" CellStyleSelector="{StaticResource FutureNet2StyleSelector}"/>
                                <telerik:GridViewDataColumn Header="T+3 Net Pos" DataMemberBinding="{Binding Path=FutureNet3, Mode=OneWay}" Width="90" TextAlignment="Right" DataFormatString="N0" CellStyleSelector="{StaticResource FutureNet3StyleSelector}"/>
                            </telerik:RadGridView.Columns>
                            <telerik:RadGridView.InputBindings>
                                <KeyBinding Key="F2" Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ClearGridFiltersCommand}"></KeyBinding>
                                <!--<KeyBinding Key="F2" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ClearGridFiltersCommand}" CommandParameter="{Binding ElementName=ExposureView}"></KeyBinding>-->
                            </telerik:RadGridView.InputBindings>
                        </telerik:RadGridView>
                        <StatusBar Grid.Row="1">
                            <StatusBar.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="200" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="200" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="50" />
                                        </Grid.ColumnDefinitions>
                                    </Grid>
                                </ItemsPanelTemplate>
                            </StatusBar.ItemsPanel>
                            <StatusBarItem Grid.Column="0">
                                <Label Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Status}" Foreground="White"/>
                            </StatusBarItem>
                            <Separator Grid.Column="1" />
                            <StatusBarItem Grid.Column="2" >
                                <StackPanel Orientation="Horizontal">
                                    <Label Content="Last Update:" Foreground="White" />
                                    <Label Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.LastUpdate}" Foreground="White"/>
                                </StackPanel>
                            </StatusBarItem>
                            <Separator Grid.Column="3"/>
                            <StatusBarItem Grid.Column="4" HorizontalAlignment="Right">
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <!--<Label Content="NET Pledged: " Foreground="White"></Label>-->
                                    <!--<Label Content="{Binding NetPledged}" ContentStringFormat="{}{0:N0}" FontWeight="Bold" Foreground="{Binding Path=NetPledged, Converter={StaticResource RedNegativeLabelForegroundConverter}}"></Label>-->
                                    <Label Content="Market Value Borrowed: " Foreground="White"/>
                                    <Label Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.TotalParNet}" ContentStringFormat="{}{0:N0}" FontWeight="Bold" Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.TotalParNet, Converter={StaticResource RedNegativeLabelForegroundConverter}}"/>
                                    <Label Content="Market Value Pledged: " Foreground="White"/>
                                    <Label Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.TotalMarketValue}" ContentStringFormat="{}{0:N0}" FontWeight="Bold" Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.TotalMarketValue, Converter={StaticResource RedNegativeLabelForegroundConverter}}"/>
                                </StackPanel>
                            </StatusBarItem>
                            <Separator Grid.Column="5" />
                            <StatusBarItem Grid.Column="6" HorizontalAlignment="Right">
                                <Label Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.RecordCount}" Foreground="White"/>
                            </StatusBarItem>
                        </StatusBar>
                    </Grid>
                </DataTemplate>
            </telerik:RadTabControl.ContentTemplate>
        </telerik:RadTabControl>

I'm using MVVM Light. The Counterparties' data context is my VM called MainViewModel.  I want the ItemsSource of my GridView to be a different property of my ViewModel, called ConsolidatedPositions. So I want the RadGridView's DataContext to be the VM, **NOT** the collection of Counterparties, which it is currently doing. 

I've found a temporary solution, but it is SLOW:

    <!--<telerik:RadGridView Grid.Row="0" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}

My Windows DataContext:

    DataContext="{Binding Main, Source={StaticResource Locator}}"

Thanks for the help.

Kiril Vandov
Telerik team
 answered on 17 Aug 2015
1 answer
124 views

Telerik provides a rich set of controls and features, but obviously we're only using a subset of all those controls. I wonder if it is possible to create a Visual Studio project to build a single assembly that contains all controls and themes that we're actually using and leaving out all non-needed controls. And doing so, would this be compliant to Telerik's license agreement?

Regards

Michael

 

Petya
Telerik team
 answered on 17 Aug 2015
1 answer
163 views

Hello, i need to do background regions for BarSeries, i just made a visualization(in attachment)

My code in this moment looks like:

<telerik:RadCartesianChart BorderThickness="1">
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="Y"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartPanAndZoomBehavior/>
    </telerik:RadCartesianChart.Behaviors>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeCategoricalAxis GapLength="0.2" x:Name="HorizontalAxis" LabelFitMode="MultiLine" LabelFormat="dd-MM-yyyy HH:mm"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries ValueBinding ="Glucose" CategoryBinding="Date" ItemsSource="{Binding BloodGlucoseList}">
            <telerik:BarSeries.PointTemplate>
                <DataTemplate>
                    <Rectangle Fill="{Binding DataItem.ChartColor}" MaxWidth="100"/>
                </DataTemplate>
            </telerik:BarSeries.PointTemplate >
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

 How can i archive my goal?

Petar Marchev
Telerik team
 answered on 17 Aug 2015
3 answers
169 views

Hello,

 I would like to show a busyindicator inside a documenthost, which I can show when loading the document.

I am using PRISM and the ShellDockingPanesFactory (from the Docking-ShellPrism example) to add my panes to the DocumentHost.

Ho can I implement this functionality without blocking my other documents or other panes?

The code below will block my whole Docking control.

 

<telerik:RadBusyIndicator DockPanel.Dock="Top" IsBusy="{Binding IsBusy}" IsIndeterminate="{Binding IsIndeterminate}"
        ProgressValue="{Binding ProgressValue}" BusyContent="{Binding BusyContent}"
        DisplayAfter="{Binding DisplayAfter}">
             
    <!-- Document tabs -->
    <telerik:RadDocking x:Name="radDocking"
                        prism:RegionManager.RegionName="WorkspaceRegion"
                        Background="LightGray" BorderThickness="0" >
 
        <telerik:RadDocking.DockingPanesFactory>
            <docking:ShellDockingPanesFactory />
        </telerik:RadDocking.DockingPanesFactory>
 
        <!-- Behaviour for catching close command in viewmodel -->
        <telerik:EventToCommandBehavior.EventBindings>
            <telerik:EventBinding Command="{Binding CloseCommand}"
                                    EventName="Close"
                                    PassEventArgsToCommand="True"/>
        </telerik:EventToCommandBehavior.EventBindings>
 
        <telerik:RadSplitContainer Height="200"
                Name="BottomContainer" InitialPosition="DockedBottom">
            <telerik:RadPaneGroup x:Name="BottomPaneGroup"/>
        </telerik:RadSplitContainer>
    </telerik:RadDocking>
             
</telerik:RadBusyIndicator>

 

Please advice.

Marcel

 

Nasko
Telerik team
 answered on 14 Aug 2015
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
Security
VirtualKeyboard
HighlightTextBlock
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?