Telerik Forums
UI for WPF Forum
5 answers
229 views
When I AutoFit() my diagram, I want all nodes to be visible on screen. However, this is impossible when the diagram is too large. The zooming restriction gets in the way.

I want to be able to zoom out until all nodes are visible on screen, no matter the size of the diagram! It doesn't matter if the rendering of the nodes suffers. In a complex diagram, I must be able to see all nodes to get an overview of its structure. This is absolutely crucial for our application so please provide us with a patch/workaround! Thanks.

I really don't understand why the zooming works this way. I get the same result if I set the Zoom to 0.1 or 0.05...
Vladimir Stoyanov
Telerik team
 answered on 11 Feb 2019
13 answers
2.7K+ views
Hello,

I'm trying to implement a "find" feature where the user can enter a value in a textbox (outside of the grid) then click a button to find the row that matches the search criteria.  I'm able to programmatically set the selectitem on the grid successfully, but if the item is not in the current scroll region the user has to scroll down to to the item.  Is there a way to ensure that the selected item is always in view?  Also, I should mention that we are using MVVM, so there is no code behind.

Thanks.
Vladimir Stoyanov
Telerik team
 answered on 11 Feb 2019
3 answers
149 views

Hello,

I like to have the width of the WeekView always equal to the width of the current parrent. But as soon as I have more Appointments ScheduleView is displaying a horizontal scrollbar and I have to scroll horizontally to see the last days of the week. (See attached Screens)

Is there an option to shrink the Appointments in width so I see always the complete week without scrolling horizontally?

Kind regards,

Markus

Dinko | Tech Support Engineer
Telerik team
 answered on 11 Feb 2019
3 answers
503 views

Hello. I use a DataTemplate for labels in BarSeries. Please see XAML below:

<telerik:RadCartesianChart Grid.Row="0" Grid.Column="0" Visibility="{Binding IsAbsoluteBarChartVisible}">
    <!--Annotation line-->
    <telerik:RadCartesianChart.Annotations>
        <telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Value="{Binding AnnotationValue}" Label="{Binding AnnotationLabel}" Stroke="Red"
                                         StrokeThickness="2" DashArray="8 2" Visibility="{Binding IsAnnotationVisible}">
            <telerik:CartesianGridLineAnnotation.LabelDefinition>
                <telerik:ChartAnnotationLabelDefinition Location="Inside"  VerticalAlignment="Bottom"  HorizontalAlignment="Center">
                    <telerik:ChartAnnotationLabelDefinition.DefaultVisualStyle>
                        <Style TargetType="TextBlock">
                            <Setter Property="FontSize" Value="14"/>
                            <Setter Property="FontWeight" Value="DemiBold"/>
                            <Setter Property="Foreground" Value="Red" />
                        </Style>
                    </telerik:ChartAnnotationLabelDefinition.DefaultVisualStyle>
                </telerik:ChartAnnotationLabelDefinition>
            </telerik:CartesianGridLineAnnotation.LabelDefinition>
        </telerik:CartesianGridLineAnnotation>
    </telerik:RadCartesianChart.Annotations>
    <!--X - axis-->
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <!--Y - axis-->
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis x:Name="verticalAxis" Title="{Binding Title_Y}"  Minimum="{Binding AbsoluteMinimum_Y}" Maximum="{Binding AbsoluteMaximum_Y}" MajorStep="{Binding AbsoluteStep_Y}"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <!--Here is bar chart itself-->
    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries ShowLabels="True" CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding Data}">
            <telerik:BarSeries.LabelDefinitions>
                <telerik:ChartSeriesLabelDefinition Margin="0 20 0 0">
                    <telerik:ChartSeriesLabelDefinition.Template>
                        <!-- !!! HERE IS PROBLEMATIC TEMPLATE !!! -->
                        <DataTemplate>
                            <TextBlock Foreground="White"/>
                        </DataTemplate>
                    </telerik:ChartSeriesLabelDefinition.Template>
                </telerik:ChartSeriesLabelDefinition>
            </telerik:BarSeries.LabelDefinitions>
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

But the labels are not visible in Bars in the chart in this case!

But when I comment the following code:

<!--telerik:ChartSeriesLabelDefinition.Template>
       <DataTemplate>
             <TextBlock Foreground="White"/>
       </DataTemplate>
</telerik:ChartSeriesLabelDefinition.Template-->

Then the labels are visible nice. Why this has plase. Please help.

Dinko | Tech Support Engineer
Telerik team
 answered on 11 Feb 2019
1 answer
170 views

Hello,

I have RadDiagram with some shapes

I tried to arrange the shapes to be one on/under other and using send backward and bring forward actions, but there is a bug in that actions

The problem is that if I clicked send backward when the shape is already in backward and then click bring to front, I have to click the same times that I clicked send backward before (if I clicked 3 times after the shape was in backward, I have to click 3 times till the shape will bring to front)

I saw the bug also in telerik demos

How can I fix this bug?

Thanks

Martin Ivanov
Telerik team
 answered on 11 Feb 2019
1 answer
854 views

Hi,

I'm looking for the best component to show some Json code

As optional it should format and highlight the code

 

Thank you

Dilyan Traykov
Telerik team
 answered on 08 Feb 2019
1 answer
535 views
Is it possible to overwrite the RadGridView Search logic and implement a custom search logic ?
My Problem is that the search works only good on text. In our grid we have columns with Date and / or columns with numbers. The search performs really poor on these types. 

I attached two gif files to showcase my problem.
Dilyan Traykov
Telerik team
 answered on 08 Feb 2019
11 answers
1.6K+ views

I have the following implicit style:

    <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
        <Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="FontSize" Value="18" />
        <Setter Property="Foreground" Value="Green" />
    </Style>

However, only the foreground color changes - all font settings are ignored. 

Searched this forum, I don't think it is Theme related, but I am using the Crystal theme

Dilyan Traykov
Telerik team
 answered on 08 Feb 2019
1 answer
383 views

Hi, I am having an issue with a standalone RadMultiColumnComboBox.  It needs to be populated differently each time I select a different entity (User) from a RadGridView.  As I understand it the only way to do this is with events. 

The problem is that I run into an exception when I try to clear the selected items from the MCCB (basically, I need to reset it), and add the new selections.  I get various ObservableCollection changed event exceptions.  

What is the correct way to do this to avoid these type of exceptions? 

Thanks,

Ian

 

Here is the code I use so far: 

 

Private changingUser As Boolean = False
 
Private Sub RadMultiColumnComboBox_SelectionChanged(sender As Object, e As SelectionChangeEventArgs)
    Try
        SyncLock lockObject
            If changingUser Then
                e.Handled = True
                changingUser = False
                Exit Sub
            End If
        End SyncLock
 
        If e.AddedItems.Count = 0 AndAlso e.RemovedItems.Count = 0 Then Exit Sub
        vm.AddRemoveRoles(e.AddedItems, e.RemovedItems)
    Catch ex As Exception
    Finally
        e.Handled = True
    End Try
End Sub
 
Private Sub Grid_SelectionChanged(sender As Object, e As SelectionChangeEventArgs)
    Try
        SyncLock lockObject
            changingUser = True
        End SyncLock
        RolesBox.SelectedItems.SuspendNotifications() 'RolesBox is the RadMultiColumnComboBox
        RolesBox.SelectedItems.Clear()
        Dim roles = vm.GetSelectedUserRoles
        For Each r In roles
            RolesBox.SelectedItems.Add(r)
        Next
    Catch ex As Exception
    Finally
        RolesBox.SelectedItems.ResumeNotifications()
 
        SyncLock lockObject
            changingUser = False
        End SyncLock
 
    End Try
 
End Sub

 

Here is an example of the exceptions I am getting: 

System.InvalidOperationException: 'Cannot change ObservableCollection during a CollectionChanged event.'

   at System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy()
   at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.Remove(T item)
   at Telerik.Windows.Controls.RadMultiColumnComboBox.OnSelectedItemPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
   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, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.MultiColumnComboBox.SelectionBridge.ItemsSelectedInOwner(IEnumerable`1 addedItems)
   at Telerik.Windows.Controls.MultiColumnComboBox.SelectionBridge.OwnerSelectedItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Feb 2019
1 answer
118 views
I've ready through the migration guide, overview, and DragDropPayloadManager guides, but there is still not enough information to migrate my existing code.Even the migration guide isn't sure which event maps to which event (see attached photo).

Can someone familiar with making the migration help me port over this code since basically everything has changed?

        public void OnDragInfo(object sender, DragDropEventArgs e)
        {
            if (e.Options.Status == DragStatus.DropImpossible && DragCue != null)
            {
                DragCue.Background = DropImpossibleBackground;
                DropIndicator.Opacity = 0;
            }
            else if (DragCue != null)
            {
                DragCue.Background = DropPossibleBackground;

                DropIndicator.HorizontalOffset = e.Options.CurrentDragPoint.X - e.Options.RelativeDragPoint.X;
                DropIndicator.VerticalOffset = e.Options.CurrentDragPoint.Y - e.Options.RelativeDragPoint.Y + DropIndicator.Height;
                Debug.WriteLine(e.Options.CurrentDragPoint);
                DropIndicator.Opacity = 100;
            }
        }

        public void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            GridViewRow row = sender as GridViewRow;

            e.QueryResult = RadDragAndDropManager.GetAllowDrag(row) &&
                (e.Options.Destination == null || e.Options.Destination is GridViewRow);

            if ((e.QueryResult ?? false) && e.Options.Status == DragStatus.DragQuery)
            {
                e.Options.Payload = row?.DataContext;
            }
        }

        public void OnDropInfo(object sender, DragDropEventArgs e)
        {
            object item = e.Options.Payload;
            GridViewRow source = e.Options.Source as GridViewRow;
            GridViewRow destination = e.Options.Destination as GridViewRow;

            if (source != null && destination != null && AssociatedObject.Items.Contains(item) && e.Options.Status == DragStatus.DragComplete)
            {
                int index = AssociatedObject.ItemContainerGenerator.IndexFromContainer(destination);

                ((IList) AssociatedObject.ItemsSource).Remove(item);

                ((IList) AssociatedObject.ItemsSource).Insert(index, item);

                if (!ItemsSourceSupportNotifications)
                {
                    AssociatedObject.Rebind();
                }

                DropIndicator.IsOpen = false;
            }

            if (e.Options.Status == DragStatus.DragCancel)
            {
                DropIndicator.IsOpen = false;
            }
        }

        public void OnDropQuery(object sender, DragDropQueryEventArgs e)
        {
            GridViewRow targetRow = e.Options.Destination as GridViewRow;

            if (targetRow != null)
            {
                e.QueryResult = targetRow.GridViewDataControl == AssociatedObject;
            }
            else
            {
                e.QueryResult = false;
            }
        }
Dinko | Tech Support Engineer
Telerik team
 answered on 07 Feb 2019
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?