Telerik Forums
UI for WPF Forum
1 answer
69 views

I am trying to show the calendar week of the selected week in the NavigationHeader. Until now i could not find any approach to do this.

Is there a possibility to show the calendar week in the NavigationHeader of a ScheduleView?

Dinko | Tech Support Engineer
Telerik team
 answered on 02 Mar 2018
2 answers
158 views
I'm using a AsyncSqlGeospatialDataReader to load some polylines. On the resulting PolylineData objects i set a ShapeFill. Is there a Template which is responsible for rendering the lines? I would like to have lines with an outline and would prefer to change the rendering instead of adding multiple layers/polylines on top of each other.
Dinko | Tech Support Engineer
Telerik team
 answered on 02 Mar 2018
4 answers
291 views

I'm trying to programatically remove a span element from a document like this:

span.Parent.Children.Remove(span);

 

This works, but it seems to mess with the formatting of the next span in the paragraph.

 

Has anybody come across this, or know of a workaround?

Tanya
Telerik team
 answered on 02 Mar 2018
5 answers
294 views

I have a RadGridView. One of column is an Expander(Not RadExpander, just a regular WPF Expander). For some reason I want to get all Expanders. So by this solution.

private List<T> GetVisualTreeObjects<T>(DependencyObject obj) where T : DependencyObject
    {
        List<T> objects = new List<T>();
        int count = VisualTreeHelper.GetChildrenCount(obj);
        for (int i = 0; i < count; i++)
        {
            DependencyObject child = VisualTreeHelper.GetChild(obj, i);
            if (child != null)
            {
                T requestedType = child as T;
                if (requestedType != null)
                    objects.Add(requestedType);
                objects.AddRange(this.GetVisualTreeObjects<T>(child));
            }
        }
        return objects;
    }

I can get all Expanders by

var all = GetVisualTreeObjects<Expander>(this.grv);

Now I have a RadDataPager for this GridView,

<telerik:RadDataPager x:Name="radDataPager"
                          Source="{Binding Items, ElementName=radGridView}"
                          PageSize="5" />

if I switch to another page, in the PageIndexChanged event. I want to get the all expanders for the current page. But the result is always wrong.

Not sure why?

 

 

gg

Dilyan Traykov
Telerik team
 answered on 02 Mar 2018
3 answers
158 views

Hi,

I have an application using the telerik docking-framework and timelines. I have an issue when undocking a frame containing a RadTimeline.

I get a NullPointerException in Telerik.Windows.Controls.TimeBar.TimeIntervalContainerBase.RemoveDummyItem.

It turns out I only get the exception when I have the Intervals property set. If I remove the Intervals it does not crash.

I have another dockpanel with a RadTimeline as well, but that one does not generate the NullPointerException, so maybe I am doing something bad.

My RadTimeline xaml which crashes looks like this:

<telerik:RadTimeline
                MinHeight="55"
                Margin="2"
                AutoSort="False"
                DurationPath="Duration"
                GroupExpandMode="None"
                ItemsSource="{Binding TimePeriods}"
                PeriodEnd="{Binding VisiblePeriodEnd, Mode=OneWay}"
                PeriodHeaderStyle="{StaticResource PeriodHeaderStyle}"
                PeriodStart="{Binding VisiblePeriodStart, Mode=OneWay}"
                ScrollMode="None"
                SnapsToDevicePixels="True"
                StartPath="Start"
                TimelineItemTemplate="{StaticResource ItemTemplate}"
                VerticalScrollBarVisibility="Hidden"
                VisiblePeriodEnd="{Binding VisiblePeriodEnd, Mode=OneWay}"
                VisiblePeriodStart="{Binding VisiblePeriodStart, Mode=OneWay}">
 
                <telerik:RadTimeline.Intervals>
                    <telerik:DayInterval FormatterProvider="{StaticResource DayFormatterProvider}" />
                </telerik:RadTimeline.Intervals>
 
            </telerik:RadTimeline>

 

Here is the callstack:

An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.DataVisualization.dll
Objektreferensen har inte angetts till en instans av ett objekt.
 
 
Ohanterat undantag: System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt.
   vid Telerik.Windows.Controls.TimeBar.TimeIntervalContainerBase.RemoveDummyItem()
   vid Telerik.Windows.Controls.TimeBar.TimeIntervalContainerBase.MeasureIntervalFormats()
   vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   vid System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   vid System.Windows.Threading.DispatcherOperation.InvokeImpl()
   vid MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   vid MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   vid System.Windows.Threading.DispatcherOperation.Invoke()
   vid System.Windows.Threading.Dispatcher.ProcessQueue()
   vid System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   vid MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   vid MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   vid System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   vid System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   vid MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   vid MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   vid System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   vid System.Windows.Application.RunDispatcher(Object ignore)
   vid System.Windows.Application.RunInternal(Window window)

 

Do you have any clue what is causing the issue?

 

Best regards

/Ola Nygren

Stefan
Telerik team
 answered on 02 Mar 2018
2 answers
127 views

Greetings,

I am currently working with a RadCartesianChart and I was wondering if it was possible to display a ScatterPointSeries with a CandleSticks instead of it's current data-point.  After reading the online documentation, I found out that I cannot use a CandlesticSeries since it requires a categorical axis for the X axis. Would it be doable to create a ScatterCandlesticSeries with the Telerik library?

 

Thank you and have a great day,

François

François
Top achievements
Rank 1
 answered on 01 Mar 2018
1 answer
610 views

I am trying to override the default behaviour for copy to clipboard from the PDF control when invoked from the keyboard.

I've created a class derived from FixedDocumentViewerCommandBase to add my custom action and this works when invoked from the Telerik toolbar or default context menu but it doesn't get invoked from the keyboard shortcut Ctrl-C.

So I've tried calling KeyBindings.Clear and adding a new KeyBinding.  At first, I thought this had not worked at all - the default copy to clipboard was executed when I selected some text.  However, what actually seems to be going on is that the KeyBindings are reset to their defaults when Mode is switched to TextSelection.

Have I missed a trick here?

Polya
Telerik team
 answered on 01 Mar 2018
2 answers
1.0K+ views

I've researched all morning how to modify the behavior of a RadGridView (in WPF) for moving focus from one control to the next, just like the Tab key does...  and like many other examples I've seen, I want to do the same thing: just make the Enter Key mimic the Tab key. But my code is not working.

If I have the following code in XAML:

                <telerik:GridViewDataColumn Name="MyColumn" CellStyleSelector="{DynamicResource MyColorStyle}" Width="64">
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="My Column" TextAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding MyNumber}" TextAlignment="Right"></TextBlock>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                    <telerik:GridViewColumn.CellEditTemplate>
                        <DataTemplate>
                            <TextBox Name="MyNumberTextBox" Text="{Binding MyNumber, Mode=TwoWay}" IsTabStop="True" TabIndex="27" PreviewKeyDown="MyNumberTextBox_PreviewKeyDown" MaxLength="10" HorizontalAlignment="Stretch" VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>

And I have this code in the code-behind:

private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
    if ((e.Key == Key.Enter) || (e.Key == Key.Return))
    {
        e.Handled = true;
        (sender as TextBox).MoveFocus(new TraversalRequest(System.Windows.Input.FocusNavigationDirection.Next));
    }
}

 

The focus does not advance to the next column immediately to the right on the RadGridView row; it instead advances back to the top of the screen (to a pulldown menu control). I have TabStops explicitly set for every textbox in my column(s).

Could use some help here to determine what I am not doing properly, or what I may be missing. Thanks in advance for your help.

 

 

 

 

Barry
Top achievements
Rank 1
 answered on 28 Feb 2018
2 answers
1.7K+ views
Hi,
I'm trying to modify the navigation with the PreviewKeyDown event, but i need the current row index of the selected cell.

Second problem is to activate editing at the selected cell after this function:
        public static void SetSelectedCell(GridViewDataControl gridView, int row, int column)
        {
            gridView.SelectedItem = gridView.Items[row];
            gridView.ScrollIntoViewAsync(gridView.SelectedItem, gridView.Columns[column], (c) => c.Focus());

            //in addition focus grid to enable keyboard navigation(e.g. F2)
            gridView.Focus();
        }
Muhammd
Top achievements
Rank 1
 answered on 28 Feb 2018
8 answers
570 views

I set FormatString="n0" on RadMaskedTextInput and it works great when adding new digits. But it doesnot update its textbox value on delete.

For example, I enter 1 000 000, it looks OK, but when I remove last digit it becomes 1 000 00 , and what we expect is 100 000

I attached a screenshot which shows how it looks like on change

Is there a workaround available to fix this? 

 

Thanks

Best regards, 

Vladimid

 

Martin Ivanov
Telerik team
 answered on 27 Feb 2018
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?