Telerik Forums
UI for WPF Forum
3 answers
143 views

Hello,

I am using your WatermarkTextBox inside a RadToolBar.The property 'WatermarkBehavior' is set to 'HiddenWhenFocused'.

Now when I am click on an area outside the RadToolBar, the Watermark text isn't reset due to the LostFocus-Event for the control is not called.

Can you help me with a workaround for that?

Thanks!

Tobias

Dilyan Traykov
Telerik team
 answered on 15 Mar 2021
1 answer
149 views

The context menu of RadOpenFolderDialog causes multiple exceptions, e.g. an arithmetic overflow.

Here are the steps to reproduce with the demo application:

   - Select a folder

   - Create new folder

   - Right click on new folder and delete it

 

When I'm  trying to use the context menu from my own application, than my application crashes immediately.

And a minor problerm: For some reason the navigation buttons in the upper left part of the dialog are missing in my application. Any idea how to solve this?

 

Thanks,

Michael

Martin Ivanov
Telerik team
 answered on 15 Mar 2021
3 answers
184 views

Hi @ all,

In the last WPF build the DataForm control got changed (single, multiple editors).
But this change broke some other functionality of the control.

I attached a screenshot of small test project when using controls from version 2020.3.1020
And also the screenshot when using controls from version 2021.1.119

This is basically the XAML code I used for the view:

<Window
    x:Class="TelerikDataFormTest.MainWindow"
    Title="MainWindow"
    Width="525"
    Height="350">
    <Window.Resources>
 
        <DataTemplate x:Key="DataFormEditTemplate">
            <StackPanel Margin="10">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*" />
                        <ColumnDefinition Width="0.5*" />
                    </Grid.ColumnDefinitions>
 
                    <StackPanel Grid.Column="0">
                        <telerik:DataFormDataField DataMemberBinding="{Binding DataName}" Label="Name" />
                        <telerik:DataFormDataField Label="Date">
                            <telerik:RadDatePicker SelectedValue="{Binding DataDate}" TodayButtonVisibility="Visible" />
                        </telerik:DataFormDataField>
 
                        <telerik:DataFormDataField Label=" ">
                            <telerik:RadButton
                                Width="250"
                                Margin="0,5,0,5"
                                HorizontalAlignment="Left"
                                Content="Test Button" />
                        </telerik:DataFormDataField>
                    </StackPanel>
 
                    <StackPanel Grid.Column="1">
                        <telerik:DataFormDataField DataMemberBinding="{Binding DataName}" Label="Name" />
                        <telerik:DataFormDataField Label="Date">
                            <telerik:RadDatePicker SelectedValue="{Binding DataDate}" TodayButtonVisibility="Visible" />
                        </telerik:DataFormDataField>
 
                        <telerik:DataFormDataField Label=" ">
                            <telerik:RadButton
                                Width="250"
                                Margin="0,5,0,5"
                                HorizontalAlignment="Left"
                                Content="Test Button" />
                        </telerik:DataFormDataField>
                    </StackPanel>
                </Grid>
            </StackPanel>
        </DataTemplate>
 
        <DataTemplate x:Key="DataFormReadOnlyTemplate">
            <StackPanel Margin="10">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*" />
                        <ColumnDefinition Width="0.5*" />
                    </Grid.ColumnDefinitions>
 
                    <StackPanel Grid.Column="0">
                        <telerik:DataFormDataField DataMemberBinding="{Binding DataName}" Label="Name" />
                        <telerik:DataFormDataField Label="Date">
                            <telerik:RadDatePicker SelectedValue="{Binding DataDate}" TodayButtonVisibility="Visible" />
                        </telerik:DataFormDataField>
 
                        <telerik:DataFormDataField Label=" ">
                            <telerik:RadButton
                                Width="150"
                                Margin="0,5,0,5"
                                HorizontalAlignment="Left"
                                Content="Test Button" />
                        </telerik:DataFormDataField>
                    </StackPanel>
 
                    <StackPanel Grid.Column="1">
                        <telerik:DataFormDataField DataMemberBinding="{Binding DataName}" Label="Name" />
                        <telerik:DataFormDataField Label="Date">
                            <telerik:RadDatePicker SelectedValue="{Binding DataDate}" TodayButtonVisibility="Visible" />
                        </telerik:DataFormDataField>
 
                        <telerik:DataFormDataField Label=" ">
                            <StackPanel>
                                <telerik:RadButton
                                    Width="150"
                                    Margin="0,5,0,5"
                                    HorizontalAlignment="Left"
                                    Content="Test Button" />
                            </StackPanel>
                        </telerik:DataFormDataField>
 
                    </StackPanel>
                </Grid>
            </StackPanel>
        </DataTemplate>
 
    </Window.Resources>
 
 
    <Grid>
 
 
        <telerik:RadDataForm
            Width="400"
            Height="300"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            AutoEdit="True"
            AutoGenerateFields="False"
            CurrentItem="{Binding Data}"
            EditTemplate="{StaticResource DataFormEditTemplate}"
            ReadOnlyTemplate="{StaticResource DataFormReadOnlyTemplate}" />
 
    </Grid>
</Window>

Until the change this worked for years now and is also used in our projects.
The question is: Is this a bug or a wanted behaviour of this control.
If there won't be a chance to use the old setting somehow we're stuck with the old version from now on.

I'm really looking forward to your suggestion on this topic.

Kind Regards,
Thomas

Martin Ivanov
Telerik team
 answered on 12 Mar 2021
2 answers
205 views
Can I remove or lock so that the user only can use RGB?
Fredrik
Top achievements
Rank 1
Veteran
Iron
 answered on 12 Mar 2021
2 answers
172 views

Version 2020.3.1020.310

I know BindingList is old from WinForms but why does it behave differently to ObservableCollection<T> and is it correct? 

Take this xaml and the code and run it.  When a new row is added the SelectedItem changes before accepting the new row.  Press escape twice to cancel the new row and the SelectedItem does not change, it is still set to the now canceled item.  Change the ItemsSource Binding from `TradeBindingList` to `Trades` and repeat.  You'll notice that SelectedItem is not changed when adding a new row.  This latter behavior is much more preferable and is correct as it does not leave the SelectedItem incorrect.  Why is this? 

        <telerik:RadGridView ItemsSource="{Binding TradeBindingList}" IsSynchronizedWithCurrentItem="True" CanUserInsertRows="True" NewRowPosition="Top" SelectedItem="{Binding SelectedTrade, Mode=TwoWay}"
                             AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding TradeNumber}"></telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>     
        </telerik:RadGridView>

 

    public partial class MainWindow : Window, INotifyPropertyChanged
    {
        object selectedTrade;

        public MainWindow()
        {
            InitializeComponent();
            Trades = new ObservableCollection<Trade>
            {
                new Trade(),
            };
            TradeBindingList = new BindingList<Trade>
            {
                new Trade(),
            };
            DataContext = this;
        }

        public ObservableCollection<Trade> Trades { get; set; }
        public BindingList<Trade> TradeBindingList { get; set; }

        public object SelectedTrade
        {
            get => selectedTrade;
            set
            {
                selectedTrade = value;
                Debug.WriteLine("Selected changed");
                OnPropertyChanged();
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }

    public class Trade : ViewModelBase
    {
        public Trade()
        {
            TradeNumber = "1";
        }
        public string TradeNumber { get; set; }
    }

Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 10 Mar 2021
6 answers
375 views
I am able to dynamically show/hide all elements of the chart trackball info on a chart except for the trackball line.  That element I cannot seem to change once the chart is showing.  

Here is where I set the line style of the trackball line just as recommended in Telerik's article.  The only difference is that did not set the visiblity to a hard-coded value.  Instead I bound it to a dependency property on my control using my well-tested bool-to-visiblity converter

<tk:RadCartesianChart x:Name="Chart"  >
 
    <tk:RadCartesianChart.TrackBallLineStyle>
        <Style TargetType="Polyline">
            <Setter Property="Visibility"
                Value="{Binding ElementName=Root, Path=ShowInfo, Converter={StaticResource CvtBoolToVis}}" />
        </Style>
    </tk:RadCartesianChart.TrackBallLineStyle>


Unfortunately that Visiblity binding in the line style is only evaluated the very first time the chart displays.  AFter that, it doesn't matter if I change that boolean "ShowInfo" property or not.  The binding never gets re-evaluated.

I've put a breakpoint in my converter to make sure it gets evaluated correctly the first time. 
I've put a breakpoint in the dependency property to verify that it truly does change.  And I even bind properties of the TrackBallBehavior to that very same ShowInfo property and their bindings DO get re-evaluated when it changes so I know that works.

<tk:ChartTrackBallBehavior ShowIntersectionPoints="{Binding ElementName=Root, Path=ShowInfo}"
                           ShowTrackInfo="{Binding ElementName=Root, Path=ShowInfo}"
                           SnapMode="ClosestPoint"
                            />



So how can I dynamically show/hide the trackball line?
Dilyan Traykov
Telerik team
 answered on 10 Mar 2021
2 answers
268 views

I would like to tweak the timeline to have it work as a "slider" for a video editing like behavior. I have made some tests and tweaks but there are a couple of points I don't manage to tweak:

1. Having a thumb position which can be set by click.

I have managed to display a bar that can move from code using the annotations and a negative margin but I would like to know if there is a way to make it work like a slider thumb (i.e. click or drag&drop)?

2. I have some trouble to find how to use custom interval type to display the text every X seconds but keep some ticks at a smaller interval (see timeline 1).

3. Is it possible to display only specific times (for example beginning and ending time) either on the ruler or as on timeline 3 image?

Note that I am using the NuGet packages and Fluent Dark Theme.

Dilyan Traykov
Telerik team
 answered on 10 Mar 2021
3 answers
175 views
We are looking for a way to manually resize the submenu for items that have a very large collection of menu items.  Sometimes, these lists are long enough that the submenu ends up taking up the entirety of the vertical space on screen, including the taskbar.  We'd like to limit the height of the submenus to the size of the current workspace, effectively allowing the panel to scroll more through the content and display less at a time.

A solution in xaml is not sufficient, as these submenus are dynamically populated in code.  We already have code set up to determine what we'd like to set the height of the submenu's panel to, but despite trying many ways of getting ahold of the correct components in code, we have been unable to successfully modify the submenu panel's height.

Anybody know of a good solution for this?
Vladimir Stoyanov
Telerik team
 answered on 10 Mar 2021
4 answers
242 views

I'm trying to build a worksheet header section with will be roughly six row.

Where cell A1 will have a fontsize of 20 and in green.

Cell D1 will be a date and time as a string.

Cell A2 will have some data, A3 blank, A4 some string, A5 some string.

Row 7 have the column header.

Not clear on how this work. My test code failed. Not understanding how Telerik walks through Cell's rows and column. Can you help with what documentation to read and samples to use?

herb
Top achievements
Rank 1
Veteran
Iron
 answered on 10 Mar 2021
1 answer
177 views

Hi,

we have a MVVM Scenario, where changes in the Raddiagram need to be reflected in the underlying viewmodel.

For shapes and connections that is easy, because we can implement IObservableGraphSource and contruct the necessary objects. ConnectionPoints however seem tricky. While moving a point triggers a ConnectionManipulationEvent, adding or deleting points via CTRL+Click apparently do not trigger this event?

I do realize that, even though it only exposes IList, ConnectionPoints is actually an ObeservableCollection and with this knowledge I can hack my way around this, but then adding a new Point causes this collection to reset and add all points one by one again, which is also not really what I want to do in my Viewmodel.

Is there an easier way to reflect these changes (adding/removing ConnectionPoints) back into the viewmodel properly, without having to create a custom ConnectionManipulationTool wihich notifies on such changes?

Thanks in advance!

Regards

Martin Ivanov
Telerik team
 answered on 10 Mar 2021
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
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?