Telerik Forums
UI for WPF Forum
1 answer
208 views

I have a RadGridView and one of the columns is called "Actions". Basically it contains a RadDropDownButton component which displays a list of actions.

The problem I have is, when I have like 50 rows in the grid, if I click on the RadDropDownButton  in the first row and then by using the mouse wheel to scroll down,

the popup window of the RadDropDownButton stays open and it loads different actions I guess for the elector the mouse wheel got focused afterwards.

 

Can somebody explain me here, what should I do?

Set the SelectedItem of the grid to the mouse wheel row that was focused or hovered?

How to get the row that is being focused or hovered with MouseWheel event?

If I set the SelectedItem to the CurrentItem will this fix my problem?

Why I see CurrentItem and no CurentRow? Because I use older version of WPF Telerid RadGridView?

Could I possibly close the popup window of the RadDropDownButton on the MouseWheel event?

 

Any other info would be useful.

Vladimir Stoyanov
Telerik team
 answered on 28 Aug 2020
1 answer
596 views

I have been trying to change the Thumb color in my RadToggleSwitchButton.

I have the following code:

<telerik:RadToggleSwitchButton
                Grid.Row="15"
                Margin="0,0,0,0"
                Padding="0"
                ContentPosition="Both"
                Foreground="White"
                IsChecked="{Binding IsRadToggleSwitchButtonChecked}">
                <telerik:StyleManager.Theme>
                    <telerik:MaterialTheme />
                </telerik:StyleManager.Theme>
 
                <ToggleButton.LayoutTransform>
                    <RotateTransform Angle="90" />
                </ToggleButton.LayoutTransform>
                <telerik:RadToggleSwitchButton.UncheckedContent>
                    <Border>
                        <TextBlock
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            FontSize="10"
                            FontWeight="Bold"
                            Foreground="White"
                            TextAlignment="Center">
                            <TextBlock.LayoutTransform>
                                <RotateTransform Angle="-90" />
                            </TextBlock.LayoutTransform>
                            T1<LineBreak />
                            t1</TextBlock>
                    </Border>
                </telerik:RadToggleSwitchButton.UncheckedContent>
 
                <telerik:RadToggleSwitchButton.CheckedContent>
                    <Border>
                        <TextBlock
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            FontSize="10"
                            FontWeight="Bold"
                            Foreground="White"
                            TextAlignment="Center">
                            <TextBlock.LayoutTransform>
                                <RotateTransform Angle="-90" />
                            </TextBlock.LayoutTransform>
                            T2<LineBreak />
                            t2</TextBlock>
                    </Border>
                </telerik:RadToggleSwitchButton.CheckedContent>
            </telerik:RadToggleSwitchButton>

 

I want to change these orange/white colors in the image attached.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 27 Aug 2020
1 answer
315 views

Hi,

I have a RadGridView which is bind on the Items property from my ViewModel :

<telerik:RadGridView x:Name="gridView" 
                             Grid.Row="1" 
                             ItemsSource="{Binding Items}"
                             >

On many column, user can Filter, Sort, ...

<telerik:GridViewDataColumn Header="Nom" 
                                        IsGroupable="False" IsSortable="True" IsFilterable="True"
DataMemberBinding="{Binding Utilisateur.Nom, Mode=OneTime}"
                                        Width="150" MinWidth="10" />

Unfortunately, the filters are reset each time the Items property is modified (if the user reloads the data, modifies his search, ...).

Is there a way to prevent this reset of the filters on the columns?

Thx,

Vladimir Stoyanov
Telerik team
 answered on 27 Aug 2020
1 answer
381 views

Hi, I'm new to Telerik and have the following problem.
I am currently using the LayoutControlSplitter.

The problem is that if I move the splitter right to the end of the window it goes outside the window.

Code:

 <Grid>    
<telerik:RadLayoutControl>   
<telerik:LayoutControlExpanderGroup Header="Expander group" />           
<telerik:LayoutControlSplitter />            
<Button Content="Button" />        
</telerik:RadLayoutControl>
</Grid>

How can I fix the problem? Thank you very much!

Vladimir Stoyanov
Telerik team
 answered on 26 Aug 2020
1 answer
328 views

Hi,

We have a series of views consisting of a search box, search options and then a results RadGridView. Since the functionality & bindings is the same on each, we have a UserControl that holds the search box & search options functionality. The only difference between each view is the Columns in RadGridView, so we are trying to put the RadGridView inside the UserControl and allow the columns to be specified by the implementing view.

Do you know how we could achieve this?

Roughly what we're trying to do:

 <UserControl x:Class="UserControls.BaseSearch" 
    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" 
    Height="Auto"  Width="Auto"> 
<Grid> 
<telerik:RadGridView Margin="0" Name="radGridView1" ItemsSource="{Binding SearchResults}" /> 
</Grid> 
</UserControl> 

<UserControl x:Class="Views.CustomerSearch" 
    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:userControls="http://schemas.telerik.com/2008/xaml/presentation" 

    Height="Auto"  Width="Auto"> 
    <Grid> 
<userControls:BaseSearch>
<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn Header="Reference"
Name="Reference"
DataMemberBinding="{Binding Reference}" Width="100">
</telerik:GridViewDataColumn>

<telerik:GridViewDataColumn Header="Description"
DataMemberBinding="{Binding Description}"
Width="200" />

<telerik:GridViewDataColumn Header="Start Date"
DataMemberBinding="{Binding StartDate, StringFormat=d}"
ShowDistinctFilters="False"
Width="130" />

</telerik:RadGridView.Columns>
</userControls:BaseSearch>
    </Grid> 
</UserControl> 

 

 

 

Vladimir Stoyanov
Telerik team
 answered on 26 Aug 2020
3 answers
103 views

I have a RadGridView which contains one column which is for input, and this column contains a CellEditTemplate with several fields for input, like name, middle names and surname.

Name and surname must not be empty for the validation to pass. When I click to add new row, the form with these fields appear in view and I can edit them.

If I add text for the mandatory fields, name and surname and then click on other column in this new row, the validation passes and form collapses, which makes the row look as saved when its not.

This could have two solutions, either tell the user that the row is still in edit mode and its not saved, or just prevent the form from collapsing.

How can I do both things for example?

Display message that the row is still in edit mode, and prevent the form from collapsing if it is still in edit mode?

 

Note: I have cell validating event set, and also name and surname have "Required" data annotation attribute.

Dilyan Traykov
Telerik team
 answered on 25 Aug 2020
1 answer
844 views

Hello

Does Telerik UI for WPF have Stepper Control like Stepper in Telerik UI for ASP.NET Core?

Thanks in advanced
Abdulsalam

Martin Ivanov
Telerik team
 answered on 24 Aug 2020
0 answers
130 views

I have a ScheduleView control and I am using a GroupHeaderContentTemplateSelector and a ResourceTypeCollection to display 3 groups:

<scheduleView:ResourceTypeCollection x:Key="ResourcesTypes">
    <scheduleView:ResourceType Name="Schedule">
        <scheduleView:Resource ResourceName="ScheduleOrder" DisplayName="Orders" />
        <scheduleView:Resource ResourceName="ScheduleHeat" DisplayName="Heats" />
        <scheduleView:Resource ResourceName="ScheduleTundish" DisplayName="Tundishes" />
    </scheduleView:ResourceType>
</scheduleView:ResourceTypeCollection>

 

<localStyles:CustomGroupHeaderContentTemplateSelector x:Key="CustomGroupHeaderContentTemplateSelector">
    <localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding FormattedName}" Margin="2" Width="80" Height="30" VerticalAlignment="Center"/>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
        <DataTemplate>
            <telerik:LayoutTransformControl VerticalAlignment="Center">
                <telerik:LayoutTransformControl.LayoutTransform>
                    <RotateTransform Angle="0" />
                </telerik:LayoutTransformControl.LayoutTransform>
                <ContentPresenter Content="{Binding FormattedName}" Margin="5" Width="70"/>
            </telerik:LayoutTransformControl>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.VerticalTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalResourceTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding Name.DisplayName}" Margin="2" Width="80" Height="30" VerticalAlignment="Center"/>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.HorizontalResourceTemplate>
 
    <localStyles:CustomGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
        <DataTemplate>
            <telerik:LayoutTransformControl VerticalAlignment="Center">
                <telerik:LayoutTransformControl.LayoutTransform>
                    <RotateTransform Angle="0" />
                </telerik:LayoutTransformControl.LayoutTransform>
                <ContentPresenter Content="{Binding FormattedName}" Margin="5" Width="60" Height="23" MaxHeight="23" MinHeight="23"/>
            </telerik:LayoutTransformControl>
        </DataTemplate>
    </localStyles:CustomGroupHeaderContentTemplateSelector.VerticalResourceTemplate>
     
</localStyles:CustomGroupHeaderContentTemplateSelector>

<scheduleView:RadScheduleView x:Name="scheduleViewOrders" Grid.RowSpan="2"
                              BorderThickness="0 1 1 1"
                              MinAppointmentHeight="20"           
                              FirstVisibleTime="00:00"
                              GroupHeaderContentTemplateSelector="{StaticResource CustomGroupHeaderContentTemplateSelector}"
                              AppointmentItemContentTemplate="{ StaticResource AppointmentTemplate}"
                              ResourceTypesSource="{StaticResource ResourcesTypes}"                                                             
                              ShowAppointmentDeleteButton="False"
                              ShowCurrentTimeIndicator="False"
                              HorizontalScrollBarVisibility="Visible">
    <scheduleView:RadScheduleView.ActiveViewDefinition>
        <scheduleView:DayViewDefinition GroupFilter="{Binding GroupFilter}" Orientation="Horizontal" VisibleDays="10" MinorTickLength="1h"
                                        MajorTickLength="1h" MinTimeRulerExtent="3000"/>
    </scheduleView:RadScheduleView.ActiveViewDefinition>                                   
    <scheduleView:RadScheduleView.GroupDescriptionsSource>
        <scheduleView:GroupDescriptionCollection>
            <scheduleView:DateGroupDescription></scheduleView:DateGroupDescription>
            <scheduleView:ResourceGroupDescription ResourceType="Schedule" />
        </scheduleView:GroupDescriptionCollection>
    </scheduleView:RadScheduleView.GroupDescriptionsSource>    
</scheduleView:RadScheduleView>

 

Now, the problem that I have is next: when I start the application there is no information to display (Image1), then I select a different day, where there is information, but something weird is happening, I can see only one row, the groups have disappeared along with the days (Image2) only after I scroll a little bit everything goes back to normal (Image3).

I am not sure what is happening, have you seen this behavior before?

 

Amige
Top achievements
Rank 1
Veteran
 asked on 21 Aug 2020
2 answers
191 views

Hi,

I tried adding a node and a link to the GraphSource. It worked but after this operation, the diagram layout seems to have been reset even though the AutoLayout property is set to True.

MainWindow.xaml.cs

using System;
using System.Windows;
using radDiagramTest.ViewModels;
using Telerik.Windows.Diagrams.Core;

namespace radDiagramTest
{
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();

      ClassificationGraphViewModel viewModel = RootGrid.Resources["ViewModel"] as ClassificationGraphViewModel;

      ClassificationDiagram.GraphSource = viewModel?.GraphSource;

      ClassificationDiagram.Loaded += ClassificationDiagram_Loaded;
      ClassificationDiagram.AutoFit( new Thickness( 10 ), false );
    }

    private void ClassificationDiagram_Loaded( Object _sender, RoutedEventArgs _e )
    {
      TreeLayoutSettings settings = new TreeLayoutSettings
      {
        TreeLayoutType = TreeLayoutType.TreeDown,
        HorizontalSeparation = 300d,
        VerticalSeparation = 75d
      };

      settings.Roots.Add( ClassificationDiagram.Shapes[0] );

      ClassificationDiagram.Layout( LayoutType.Tree, settings );
      ClassificationDiagram.AutoLayout = true;
      ClassificationDiagram.IsEditable = false;
    }
  }
}

NodeViewModel.cs (node custom view model where the Add button is)

using System;
using System.Windows;
using System.Windows.Input;
using radDiagramTest.ViewModels;
using Telerik.Windows.Controls.Diagrams.Extensions.ViewModels;

namespace radDiagramTest
{
  public class NodeViewModel : HierarchicalNodeViewModel
  {
    public NodeViewModel( ClassificationGraphViewModel _parent )
    {
      m_Parent = _parent;

      AddNodeCommand = new SimpleCommand( AddNodeCommandHandler );
    }

    public ICommand AddNodeCommand { get; set; }
    public String Name { get; set; }

    private void AddNodeCommandHandler()
    {
      NodeViewModel newNode = new NodeViewModel( m_Parent ) { Name = "New Node" };
      m_Parent.GraphSource.AddNode( newNode );

      LinkViewModel newLink = new LinkViewModel( this, newNode ) { Name = "New Edge" };
      m_Parent.GraphSource.AddLink( newLink );
    }

    private readonly ClassificationGraphViewModel m_Parent;
  }
}

Dominik
Top achievements
Rank 1
 answered on 21 Aug 2020
1 answer
226 views

Hi,I'm Using Custom Shape  and I want to Add a ListBox to the SettingsPaneView and Bind the shape's ViewModel to the Listbox ,but the data now show ,Anybody can help me,Thanks.

 

private List<AdjacentSpace6VM> _AdjacentSpaces;
 
    public List<AdjacentSpace6VM> AdjacentSpaces
    {
        get
        {
            return _AdjacentSpaces;
        }
        set
        {
            _AdjacentSpaces = value;
            OnPropertyChanged(() => this.AdjacentSpaces);
        }
    }
<ListBox extensions:SettingsPaneView.EditorPropertyName="DataContext.AdjacentSpaces" extensions:SettingsPaneView.EditorItemType="Shapes,Custom, Connections" extensions:SettingsPaneView.EditorValue="{Binding Path=ItemsSource, Mode=TwoWay, RelativeSource={RelativeSource Self}}" Grid.Row="3" Grid.ColumnSpan="2">
                      <ListBox.ItemsPanel>
                          <ItemsPanelTemplate>
                              <UniformGrid Columns="3" IsItemsHost="True" Margin="0" />
                          </ItemsPanelTemplate>
                      </ListBox.ItemsPanel>
                      <ListBox.ItemContainerStyle>
                          <Style TargetType="{x:Type ListBoxItem}">
                              <Setter Property="Template">
                                  <Setter.Value>
                                      <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                          <Grid>
                                              <Grid.ColumnDefinitions>
                                                  <ColumnDefinition></ColumnDefinition>
                                                  <ColumnDefinition></ColumnDefinition>
                                              </Grid.ColumnDefinitions>
                                              <TextBlock Grid.Column="0" Text="{Binding Number}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="30 10 0 20" Foreground="White"></TextBlock>
                                              <TextBlock Grid.Column="1" Text="{Binding CT}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="10 10 30 20" Foreground="White"></TextBlock>
                                              <TextBlock Grid.Column="1" Text="aaa" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30" Margin="10 10 30 20" Foreground="White"></TextBlock>
                                          </Grid>
                                      </ControlTemplate>
                                  </Setter.Value>
                              </Setter>
                          </Style>
                      </ListBox.ItemContainerStyle>
                  </ListBox>
Vladimir Stoyanov
Telerik team
 answered on 21 Aug 2020
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
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?