Telerik Forums
UI for WPF Forum
5 answers
799 views
I have problem with RadGridView and grid splitter. it happens when the columns are more than the visible part of RadGridView and you try to move grid splitter doesn't move here is example code:   StyleManager.ApplicationTheme = new FluentTheme();
<telerik:RadRibbonWindow x:Class="TelerikWpfApp1.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"
                         xmlns:prism="http://prismlibrary.com/"
                         Title="MainWindow" Height="350" Width="525" WindowState="Maximized"
                         prism:ViewModelLocator.AutoWireViewModel="True">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <telerik:RadGridView ItemsSource="{Binding Models}" AlternationCount="2"
                             AutoGenerateColumns="False"
                             IsReadOnly="True"
                             Grid.Column="0"
                             IsFilteringAllowed="True"
                             FilteringMode="Popup"
                             BorderThickness="1">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test1}" Header="Test 1" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test2}" Header="Test 2" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test2}" Header="Test 3" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test4}" Header="Test 4" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test5}" Header="Test 5" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test6}" Header="Test 6" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test7}" Header="Test 7" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test8}" Header="Test 8" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test9}" Header="Test 9" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test10}" Header="Test 10" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test11}" Header="Test 11" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test12}" Header="Test 12" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test13}" Header="Test 13" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test14}" Header="Test 14" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test15}" Header="Test 15" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test16}" Header="Test 16" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test17}" Header="Test 17" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test18}" Header="Test 18" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test19}" Header="Test 19" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test20}" Header="Test 20" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test21}" Header="Test 21" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test22}" Header="Test 22" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test23}" Header="Test 23" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test24}" Header="Test 24" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test25}" Header="Test 25" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Test26}" Header="Test 26" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <GridSplitter Grid.Column="1" Width="10" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns"/>
        <WebBrowser Grid.Column="2"/>
    </Grid>
</telerik:RadRibbonWindow>
Dinko | Tech Support Engineer
Telerik team
 answered on 11 Feb 2019
5 answers
221 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.6K+ 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
146 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
479 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
166 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
817 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
523 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.5K+ 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
371 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?