5 Answers, 1 is accepted
0
Hello Harlan,
There is no "out of the box" solution for your request. In order to set the described behavior you should change the control template to disable or hide the button. We've attached a sample project, where you can see how we've achieved this, but in short we followed these steps:
You can visit our online help page, where the whole process is described in a very detailed way.
Kind regards, Alek
the Telerik team
There is no "out of the box" solution for your request. In order to set the described behavior you should change the control template to disable or hide the button. We've attached a sample project, where you can see how we've achieved this, but in short we followed these steps:
- create a new folder in you solution and copy the references from NoXaml folder (installation directory). Entering in the Telerik.Windows.Controls.Input.xaml you should look how a comment "NOTE". There we made the change;
- add a reference in App.xaml;
You can visit our online help page, where the whole process is described in a very detailed way.
Kind regards, Alek
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Kim
Top achievements
Rank 1
answered on 17 Jun 2014, 02:21 AM
Hello Alek,
i just want it's made optional one time show one time not show.
so, i think make a behavior that below as..but it's not work.
please give your advice..
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Telerik.Windows.Controls;namespace Lge.Bms.Viewer.CommonUI.Behavior
{
/// <summary>
/// Rad Control의 RadDropDownButton을 Visibility을 컨트롤 한다.
/// </summary>
public class RadControlDropDownButtonBehavior
{
public static readonly DependencyProperty IsVisibilityProperty = DependencyProperty.RegisterAttached("IsVisibility", typeof(bool), typeof(RadControlDropDownButtonBehavior), new PropertyMetadata(true, OnControlActive)); public static void SetIsVisibility(DependencyObject d, bool enabled)
{
d.SetValue(IsVisibilityProperty, enabled);
} public static bool GetIsVisibility(DependencyObject d)
{
return (bool)d.GetValue(IsVisibilityProperty);
} private static void OnControlActive(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
//추후 숨겨할 RadDropDownButton의 Name을 조건문에 추가 수정한다.
switch (d.GetType().ToString())
{
case "Telerik.Windows.Controls.RadDateTimePicker":
var dropDownButtons = (d as RadDateTimePicker).ChildrenOfType<RadDropDownButton>().Where(x => x.Name == "PART_DropDownButton");
foreach (var item in dropDownButtons)
{
item.Visibility = (bool)e.NewValue ? Visibility.Visible : Visibility.Collapsed;
}
break;
case "Telerik.Windows.Controls.RadTimePicker":
dropDownButtons = (d as RadTimePicker).ChildrenOfType<RadDropDownButton>().Where(x => x.Name == "PART_DropDownButton");
foreach (var item in dropDownButtons)
{
item.Visibility = (bool)e.NewValue ? Visibility.Visible : Visibility.Collapsed;
}
break;
}
}
}
}
i just want it's made optional one time show one time not show.
so, i think make a behavior that below as..but it's not work.
please give your advice..
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Telerik.Windows.Controls;namespace Lge.Bms.Viewer.CommonUI.Behavior
{
/// <summary>
/// Rad Control의 RadDropDownButton을 Visibility을 컨트롤 한다.
/// </summary>
public class RadControlDropDownButtonBehavior
{
public static readonly DependencyProperty IsVisibilityProperty = DependencyProperty.RegisterAttached("IsVisibility", typeof(bool), typeof(RadControlDropDownButtonBehavior), new PropertyMetadata(true, OnControlActive)); public static void SetIsVisibility(DependencyObject d, bool enabled)
{
d.SetValue(IsVisibilityProperty, enabled);
} public static bool GetIsVisibility(DependencyObject d)
{
return (bool)d.GetValue(IsVisibilityProperty);
} private static void OnControlActive(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
//추후 숨겨할 RadDropDownButton의 Name을 조건문에 추가 수정한다.
switch (d.GetType().ToString())
{
case "Telerik.Windows.Controls.RadDateTimePicker":
var dropDownButtons = (d as RadDateTimePicker).ChildrenOfType<RadDropDownButton>().Where(x => x.Name == "PART_DropDownButton");
foreach (var item in dropDownButtons)
{
item.Visibility = (bool)e.NewValue ? Visibility.Visible : Visibility.Collapsed;
}
break;
case "Telerik.Windows.Controls.RadTimePicker":
dropDownButtons = (d as RadTimePicker).ChildrenOfType<RadDropDownButton>().Where(x => x.Name == "PART_DropDownButton");
foreach (var item in dropDownButtons)
{
item.Visibility = (bool)e.NewValue ? Visibility.Visible : Visibility.Collapsed;
}
break;
}
}
}
}
0
Hi Kim,
Basically your code is working fine. The only change we've made is to moved the switch logic in the Loaded event as the control template needs a time to be loaded. This is the reason why it is not worked initially.
For your convenience we've added a sample project as an attached file where you can see our approach.
We hope that the solution will fit to your needs.
Regards,
Alek
Telerik
Basically your code is working fine. The only change we've made is to moved the switch logic in the Loaded event as the control template needs a time to be loaded. This is the reason why it is not worked initially.
For your convenience we've added a sample project as an attached file where you can see our approach.
We hope that the solution will fit to your needs.
Regards,
Alek
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Kim
Top achievements
Rank 1
answered on 18 Jun 2014, 02:24 AM
Hi Alek,
thanks your solution,
it's problem that event ocurred loaded time.
thanks your solution,
it's problem that event ocurred loaded time.
0
Hi Kim,
Could you please tell us is the proposed solution worked for you or you are still experiencing issues?
Regards,
Alek
Telerik
Could you please tell us is the proposed solution worked for you or you are still experiencing issues?
Regards,
Alek
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.