Telerik Forums
UI for WPF Forum
5 answers
932 views
Hi,

I have a RadDatePicker where i can type the date and also i select a date.

I have a save button which should become enabled the moment i change the date in date picker.

Problem is only when i change the date using datepicker, the save is getting triggered. If i type in a date, only when the datepicker is lost focus, save is getting enabled. I want the save to be enabled the moment i type in some text using keyboard in the datepicker text box.

I am using the following code and it is not working

SelectedDate

 

 

="{Binding Path=SampleDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"

Note: In WPF datepicker i have a "Text" property where the UpdateSourceTrigger works perfectly. Need a similar behavior in RadDatePicker also.

Also I am using MVVM model. So i need suggestions which does not require XAML.cs change. All i should do is within XAML.

I have pasted a sample code below. Just type in some valid date in WPF datepicker, button will be enabled. But the same button is not getting enabled if i type in a date in RadDatePicker. You might know better than me... I need the same behavior as like the WPF date picker. Please help

 

<Window x:Class="DatePickerTextBoxSample.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" 
        Title="MainWindow" Height="350" Width="525">  
    <Grid> 
          
        <Button Name="SampleButton" Content="Click Here" Height="20" Width="150" HorizontalAlignment="Left" VerticalAlignment="Bottom" IsEnabled="{Binding Path=IsDateChanged,Mode=TwoWay}" Click="SampleButton_Click" /> 
        <DatePicker Text="{Binding Path=WpfDatePickerDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" HorizontalAlignment="Left" Margin="118,218,0,0" Name="datePicker1" VerticalAlignment="Top" Width="115" /> 
        <telerik:RadDatePicker SelectedDate="{Binding Path=RadDatePickerDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" HorizontalAlignment="Left" Margin="250,218,0,0" Name="datePicker2" IsDropDownOpen="False" VerticalAlignment="Top" Width="115" /> 
          
    </Grid> 
</Window> 
 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.Windows;  
using System.Windows.Controls;  
using System.Windows.Data;  
using System.Windows.Documents;  
using System.Windows.Input;  
using System.Windows.Media;  
using System.Windows.Media.Imaging;  
using System.Windows.Navigation;  
using System.Windows.Shapes;  
using System.ComponentModel;  
 
namespace DatePickerTextBoxSample  
{  
    /// <summary> 
    /// Interaction logic for MainWindow.xaml  
    /// </summary> 
    public partial class MainWindow : Window, INotifyPropertyChanged  
    {  
        private DateTime radDatePickerDate;  
        private DateTime wpfDatePickerDate;  
 
        public DateTime WpfDatePickerDate  
        {  
            get { return wpfDatePickerDate; }  
            set   
            {   
                wpfDatePickerDate = value;  
                IsDateChanged = true;  
                NotifyPropertyChanged("WpfDatePickerDate");  
            }  
        }  
 
        private bool _isDateChanged;  
 
        public bool IsDateChanged  
        {  
            get { return _isDateChanged; }  
            set   
            {   
                _isDateChanged = value;  
                NotifyPropertyChanged("IsDateChanged");  
            }  
        }  
          
        public DateTime RadDatePickerDate   
        {  
            get  
            {  
                return radDatePickerDate;  
            }  
            set  
            {  
                wpfDatePickerDate = value;  
                IsDateChanged = true;  
                NotifyPropertyChanged("RadDatePickerDate");  
            }  
        }  
         
        public MainWindow()  
        {  
            InitializeComponent();  
            thisthis.DataContext = this;  
        }  
 
        #region INotifyPropertyChanged Members  
 
        public event PropertyChangedEventHandler PropertyChanged;  
 
        protected void NotifyPropertyChanged(String info)  
        {  
            if (PropertyChanged != null)  
            {  
                PropertyChanged(this, new PropertyChangedEventArgs(info));  
            }  
        }  
 
        #endregion  
 
        private void SampleButton_Click(object sender, RoutedEventArgs e)  
        {  
            SampleButton.IsEnabled = false;  
        }  
    }  
}  
 

Dilyan Traykov
Telerik team
 answered on 27 Jul 2020
5 answers
324 views

Hi there,

I'd like to change the padding of my listbox on the right side depending on the 3 states of the vertical scrollbar (i.e collapsed, compact, normal).

Doing the following tweak allows me to change the padding when the vertical scrollbar is visible or not but I can't find how to change the padding based on the compact/normal mode state of the scrollbar.

<telerik:RadListBox.Style>
    <Style TargetType="{x:Type telerik:RadListBox}">
        <Setter Property="Padding" Value="8,4" />
        <Style.Triggers>
            <Trigger Property="ScrollViewer.ComputedVerticalScrollBarVisibility" Value="Visible">
                <Setter Property="Padding" Value="8,4,24,4" />
            </Trigger>
        </Style.Triggers>
    </Style>
</telerik:RadListBox.Style>
Dilyan Traykov
Telerik team
 answered on 24 Jul 2020
1 answer
127 views

Hi!

According to the documentation for SpreadsheetStreamingExport there is a property "ExcludedColumns" in the class "GridViewSpreadStreamExportOptions". See here . This property is missing and only available in "GridViewDocumentExportOptions". I really miss this property badly because I have to exlude some columns when exporting. Is this a bug or error in documentation? 

Best regards
Heiko

Yoan
Telerik team
 answered on 24 Jul 2020
3 answers
403 views

In the sample below, copy and paste will operate on the row as expected but delete is disabled. I'm expecting delete to allow me to delete the row (as if I pressed the delete key on the keyboard).

 

<telerik:RadGridView x:Name="RadGridView" >
    <telerik:RadGridView.ContextMenu>
        <ContextMenu >
            <MenuItem Command="ApplicationCommands.Copy"></MenuItem>
            <MenuItem Command="ApplicationCommands.Paste"></MenuItem>
            <MenuItem Command="ApplicationCommands.Delete"></MenuItem>
        </ContextMenu>
    </telerik:RadGridView.ContextMenu>
</telerik:RadGridView>

 

public GridMenuTestWindow ()
        {
        InitializeComponent ();
 
        ObservableCollection<MyData> dataList = new ObservableCollection<MyData> ();
 
        for (int i = 0; i < 4; i++)
            {
            dataList.Add (new MyData () {Name = "Name" + i});
            }
        this.RadGridView.ItemsSource = dataList;      
        }  
 
public class MyData
    {
    public String Name { get; set; }
    }
Dinko | Tech Support Engineer
Telerik team
 answered on 24 Jul 2020
3 answers
350 views

When I try to crop a large image (10 MB jpg), I always get an "Out of memory exception". I there a size limit for images?

 

Stack trace:

Exception of type 'System.OutOfMemoryException' was thrown.*   at Telerik.Windows.Media.Imaging.RadBitmap.GetPixels()
   at Telerik.Windows.Media.Imaging.RadBitmap.Crop(Int32 x, Int32 y, Int32 newWidth, Int32 newHeight)
   at Telerik.Windows.Media.Imaging.Commands.CropCommand.Execute(RadBitmap source, Object context)
   at Telerik.Windows.Media.Imaging.History.ImageHistory.Execute(IImageCommand command, Object context)
   at Telerik.Windows.Controls.RadImageEditor.ExecuteCommand(IImageCommand command, Object context)
   at Telerik.Windows.Controls.RadImageEditor.CommitTool(Boolean executeSameToolAfterCommit)
   at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.ImageEditorDialog.OK_Click(Object sender, RoutedEventArgs e)
   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.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at Telerik.Windows.Controls.RadButton.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()
   at Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(Boolean isModal)
   at Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal)
   at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.ImageEditorDialog.ShowDialogInternal(Inline orgInline, Action`2 replaceCurrentImageCallback, String executeToolName, RadRichTextBox owner)
   at Telerik.Windows.Controls.RichTextBoxUI.Dialogs.ImageEditorDialog.ShowDialog(Inline selectedImage, Action`2 replaceCurrentImageCallback, String executeToolName, RadRichTextBox owner)
   at Telerik.Windows.Controls.RadRichTextBox.ShowImageEditorDialog(String executeToolName)
   at Telerik.Windows.Controls.RichTextBoxUI.ImageMiniToolBar.ExecuteShowImageEditor(Object param)
   at Telerik.Windows.Controls.DelegateCommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at Telerik.Windows.Controls.RadButton.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()

...

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Jul 2020
2 answers
560 views

I am trying to change a CornerRadius value with StaticResource but there is an error showing.

My goal is to override CornerRadius of my controls. For instance, a RadComboBox. I already have the Style RadComboBoxStyle which have the following Setter value.

<Setter Property="mat:MaterialAssist.CornerRadius" Value="{telerik:FluentResource ResourceKey=CornerRadius}"/>

 

When I input numeric value (5, 10) as Value, I works well. But I want to have a StaticResource that holds the numeric value so I created a System:Double resource that holds the cornerradius value but when I put it as Value in the Style Setter, an error is showing. 

 

My code 

<Setter Property="mat:MaterialAssist.CornerRadius" Value="{StaticResource GenericInputCornerRadius}"/>

Error

''5' is not a valid value for property 'CornerRadius'.'

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Jul 2020
1 answer
226 views

When the RadLinearSparline is in AutoRange, is there a way to get the actual Y Axis Min Range and Max Range values? These values would then be displayed in a separate control.   I have bound the MinYValue and MaxYValue to properties and am able to get the values when AutoRange = false but when AutoRange = true the MinYValue and MaxY are always 0.

<telerik:RadLinearSparkline  Grid.Row="0" Grid.RowSpan="3" Grid.Column="1"
                                       ItemsSource="{Binding AsyncData, Converter={StaticResource collectionConverter}}"
                                                                
                                       YValuePath="YVal"
                                       LineStroke="{Binding FontColor}"
                                       ShowNormalRange="True"
                                       AutoRange="{Binding AutoRange}"
                                       MinYValue="{Binding MinYvalue}"
                                       MaxYValue="{Binding MaxYvalue}"
                                       NormalRangeTop="{Binding Maximum}"
                                       NormalRangeBottom="{Binding Minimum}"
                                       EmptyPointBehavior="DropPoint"
                                                                >

 

 

Vladimir Stoyanov
Telerik team
 answered on 22 Jul 2020
1 answer
111 views

Hi,

I'm using WmsTiledProvider. My problem is that the format value sent is PNG and I cannot change it. How can I solve this problem.








 

 

Vladimir Stoyanov
Telerik team
 answered on 22 Jul 2020
1 answer
238 views

Hello

I want to buy DevCraft Complete, I want to be confirmed that I can use RadWebCam with digital camera instead of web cam, my application  senario is as following:

I want to connect the digital camera to the PC (sony or canon digital camera) then when I open the window that has RadWebCam conrol, the user can capture the photo from the digital camera instead of capture the photo from the camera it self (using the capture button on the camera)

Is this possible with WebCam control?

Thanks

Abdulsalam

Ivan Petrov
Telerik team
 answered on 21 Jul 2020
0 answers
137 views

in attached screenshot, I need to make all rows expanded always, so that I can select only radio button at a time. as of I now if I select a row and collapse it, it allows to choose another value from expanded rows. which cause application to crash, I need to keep only one selected radio button value from all available rows.

code for radio button below:

 

<StackPanel Orientation="Horizontal">
                                                <RadioButton                                                  
                                                    Margin="0,0,10,0"
                                                    VerticalAlignment="Center"
                                                    GroupName="IndexedValue"
                                                    IsChecked="{Binding IsIndexedValue}" ToolTip="Select Only 1 value for indexing">
                                                    <RadioButton.Visibility>
                                                        <Binding                                                           
                                                            Converter="{StaticResource IsIndexedValueSelectedToVisibilityConverter}"
                                                            Path="DataContext.IsIndexedValueSelected" 
                                                            Source="{x:Reference ParameterValueListView}"/>
                                                    </RadioButton.Visibility>
                                                </RadioButton>

yogeshwar
Top achievements
Rank 1
 asked on 21 Jul 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?