Telerik Forums
UI for WPF Forum
2 answers
374 views

Please consider the attached image.

How can I prevent the editor from line breaking when the selected item in the combobox fills out the whole (or more) width of the combobox editor? I want it to keep the height of a single line and just scroll the text, like in a single line textbox.

ClausDC
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 07 Jun 2022
1 answer
385 views

Hi, 

I try to select a child item in a TreeListView WO succes... When I try to select the root node it works fine.

Did I miss something ?

Thanks!

This is my code:

 <Grid x:Name="layoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
            <Button x:Name="button" Height="20" Command="{Binding CmdAdd}">Add</Button>
            <Button x:Name="button2" Height="20" Command="{Binding CmdSelectLastItemAdded}">Select last child added</Button>
            <Button x:Name="button3" Height="20" Command="{Binding CmdSelectRootNode}">Select root</Button>
        </StackPanel>
        
        <!-- The Tree -->
        <telerik:RadTreeListView x:Name="TreeListView" ItemsSource="{Binding Items}"
                                 CanUserFreezeColumns="False" 
                                 RowIndicatorVisibility="Collapsed" 
                                 ColumnWidth="auto" 
                                 AutoGenerateColumns="False" 
                                 IsDragDropEnabled="True"
                                 IsDropPreviewLineEnabled="False"
                                 ShowColumnHeaders="True"
                                 SelectionMode="Extended" 
                                 GridLinesVisibility="None"
                                 IsSynchronizedWithCurrentItem="False"
                                 SelectedItem="{Binding SelectedItem , Mode=TwoWay}"
                                 IsExpandedBinding="{Binding IsExpandedInTree, Mode=TwoWay}"
                                 Margin="5" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4">


            <!-- The columns -->
            <telerik:RadTreeListView.Columns>

                <telerik:GridViewColumn Name="colName" Header="Name" FilterMemberPath="DisplayName">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate DataType="local:ITreeItem">

                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <CheckBox IsChecked="{Binding IsVisible, Mode=OneWay}" />
                                <TextBlock Text="{Binding DisplayName}" Grid.Column="2" VerticalAlignment="Center"/>
                            </Grid>

                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>

                    <telerik:GridViewColumn.CellEditTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding DisplayName}" Margin="2"/>
                        </DataTemplate>
                    </telerik:GridViewColumn.CellEditTemplate>

                </telerik:GridViewColumn>

            </telerik:RadTreeListView.Columns>

            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>
    </Grid>


 public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            TreeListView.RowHeight = 20;
            var vm = new TreeVM();
            DataContext = vm;
        }

        public class TreeVM : ReactiveObject
        {
            private TreeItem _lastItemAdded;
            private TreeItem _firstItem;

            public Action <TreeItem> action { get; set; }

            private TreeItem _selectedItem;
            public TreeItem SelectedItem
            {
                get => _selectedItem;
                set => this.RaiseAndSetIfChanged(ref _selectedItem, value);
            }

            public ICommand CmdAdd { get; }
            public ICommand CmdSelectLastItemAdded { get; }
            public ICommand CmdSelectRootNode { get; }
            public TreeVM()
            {
                _items = new ObservableCollection<ITreeItem>();
                _firstItem = new TreeItem();
                _firstItem.DisplayName = "Root";
                _items.Add(_firstItem);
                CmdAdd = ReactiveCommand.Create(AddChild);
                CmdSelectLastItemAdded = ReactiveCommand.Create(Select);
                CmdSelectRootNode = ReactiveCommand.Create(SelectRoot);
            }

            private void Select()
            {
                SelectedItem = _lastItemAdded;
            }

            private void SelectRoot()
            {
                SelectedItem = _firstItem;
            }

            private void AddChild()
            {
                var childitem = new TreeItem();
                childitem.DisplayName = "Parent";

                var child = new TreeItem();
                child.DisplayName = "child1";
                childitem.Children.Add(child);

                child = new TreeItem();
                child.DisplayName = "child2";
                childitem.Children.Add(child);
                child = new TreeItem();
                
                _items[0].Children.Add(childitem);

                _lastItemAdded = child;
            }

            private ObservableCollection<ITreeItem> _items;

            public ObservableCollection<ITreeItem> Items
            {
                get => _items;
                set => this.RaiseAndSetIfChanged(ref _items, value);
            }
        }
    }

Martin Ivanov
Telerik team
 answered on 07 Jun 2022
0 answers
141 views

Hello,
In a behavior on RadGridView I'm subscribing to KeyDownEvent, and when I press Enter, I execute the following code:

I wanted to check what happens if I hit Enter without selecting any cell in the grid.
So first, I click outside the grid, this selects the first cell of the grid in an "unfocused" style:

Then, I hit Enter a first time:  my code hits the first condition (AssociatedObject.SelectedCells.Count == 0) and does the early-return.
It also selects the next cell in the column:

I hit Enter a second time: my code hits the second condition (the one underlined in red), and throws an ArgumentException:

From what I understand, this is raised from CellInfoCollection.Contains, so from code I cannot debug since it's a Telerik dll.
Do you have more info on this? What am I doing wrong?
Thanks!

Eldoir
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 07 Jun 2022
0 answers
135 views

I have a simple use case where if the Checkbox in column-1 is unchecked  there should be some indication in the row (such as the row being grayed out).

In the example below, I would like the unchecked row "40 ,00, 00 00 03...) to be visually different than the checked row above.

What is the easiest way to accomplish this ?

Your help is appreciated.

Priya
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 06 Jun 2022
0 answers
121 views

We have an application that uses the docking mechanism, and have started seeing an exception when dragging the tab for the RadDocumentPane. This is difficult to reproduce but usually happens before the 100th attempt to drag the window (often under 10 attempts). The stack trace doesn't have any of our code in it and I'm stuck trying to understand what the Telerik control is attempting to do. Some help understanding would be useful.

This only seems to happen when attached to a new control (the microsoft automatic graph layout one) that uses a canvas underneath, I'm tempted to wonder whether the resize event is racing with the drag, but I only have a casual model of the Telerik control to try understand what's happening. I'd really just be happy to catch the exception somehow so the user doesn't see it, it doesn't seem to impact any other behaviour


[10:37:52 ERR] Unhandled exception occurred
System.ArgumentNullException: Value cannot be null.
Parameter name: current
   at System.Windows.LogicalTreeHelper.GetParent(DependencyObject current)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.IsLogicalAncestorOf(DependencyObject ancestor, DependencyObject descendant)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.TryBeginDrag()
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.OnElementMouseMove(Object sender, MouseEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Phillip
Top achievements
Rank 1
 asked on 06 Jun 2022
0 answers
107 views

Hi,

I'm trying to load a RadGridView layout with differente columns number ... I've a layout with "Description" column but now I need to remove it.. But during loading an exception was throw!

How can I handle this type of situation? It may often happen that I have to remove some columns.

Simone
Top achievements
Rank 1
 asked on 06 Jun 2022
1 answer
113 views

Hello,

I'm using a textbox where the user can type something, and my RadGridView only shows the relevant columns. For example if the user types "rad", I will only show columns containing "rad" in their header.

I just noticed when the columns are filtered out this way, and I select a range of cells, it also includes the cells from the hidden columns!

How to only include cells from visible columns in the range?

For example on this screenshot I selected the top left cell then hold Shift and selected the bottom right cell.

We see that 4 cells are selected, but actually much more got selected! (all the ones in the red box, so from "SourceRadius" to "Reach Radius" columns, because I guess internally you're using column indexes to select the range of cells?)

I must precise I'm using dynamically created columns, if it matters.

Thanks!

Eldoir
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 03 Jun 2022
1 answer
128 views

Hi, is it posible to add a baseline to a Milestone? Such the one in the photo. 

imagen

Martin Ivanov
Telerik team
 answered on 02 Jun 2022
1 answer
150 views

I tried to look up the code that does this but I did not find it.

I would like if you could explain or give the code of this Panel that knows how to push the Schedule and Panel accordingly.

 

Martin Ivanov
Telerik team
 answered on 02 Jun 2022
0 answers
126 views

Hi, I am using the following code for the search as you type control inside a grid view:

<ControlTemplate x:Key="GridViewSearchPanelTemplate" TargetType="grid:GridViewSearchPanel">
        <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
            <Grid UseLayoutRounding="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock
                            telerik:LocalizationManager.ResourceKey="GridViewSearchPanelTopText"
                            TextWrapping="Wrap"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            IsHitTestVisible="False"/>
                    <Grid Grid.Column="1" Margin="10 0 10 0" VerticalAlignment="Center">
                        <TextBox x:Name="PART_SearchAsYouTypeTextBox"
                                AutomationProperties.Name="search as you type textBox"
                                Text="{Binding SearchText, Mode=TwoWay}"
                                MinWidth="160"
                                MaxWidth="200"
                                MinHeight="20"
                                Padding="3 3 15 3"
                                telerik:StyleManager.Theme="{StaticResource Theme}"
                                telerik:TextBoxBehavior.UpdateTextOnEnter="True"
                                FontSize="{Binding FontSize, RelativeSource={RelativeSource TemplatedParent}}"
                                IsTabStop="{TemplateBinding IsTabStop}"/>
                        <telerik:RadButton x:Name="ClearButton"
                                IsTabStop="False"
                                Visibility="Collapsed"
                                Style="{StaticResource ClearSearchValueButtonStyle}"
                                Command="searchPanel:GridViewSearchPanelCommands.ClearSearchValue"/>
                        <Grid.Triggers>
                            <EventTrigger RoutedEvent="MouseEnter">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ClearButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                            <EventTrigger RoutedEvent="MouseLeave">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ClearButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>
                        </Grid.Triggers>
                    </Grid>
                </Grid>
                <telerik:RadPathButton x:Name="CloseButton"
                        PathGeometry="M1,0 L4,3 L7,0 L8,1 L5,4 L8,7 L7,8 L4,5 L1,8 L0,7 L3,4 L0,1 z"
                        Visibility="{TemplateBinding CloseButtonVisibility}"
                        Grid.Column="1"
                        Width="22"
                        Height="22"
                        Padding="7"
                        Margin="0 5 5 5"
                        IsBackgroundVisible="False"
                        IsTabStop="False"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Center"
                        Command="controls:RadGridViewCommands.CloseSearchPanel"/>
            </Grid>
        </Border>
    </ControlTemplate>

The ClearButton is never enabled and because of this the command, nor the mouse hovering doesn't work. If I remove the command the button is enabled, so it would seem that the CanExecute of the command never returns true. Why is that?

I am using telerik version 2022.1.222

Remus
Top achievements
Rank 1
Veteran
 asked on 02 Jun 2022
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?