Telerik Forums
UI for WPF Forum
7 answers
254 views

Is it possible to configure an automatic connection routing in RadDiagram like in the "TableShape" example?

Please look at "MyRoute.png" for my route looks now and "ExampleRoute.png" for what my route should look like.

Martin Ivanov
Telerik team
 answered on 29 Mar 2017
1 answer
86 views

Hello,

Is there a way to avoid that during the ordering a task child of a summary node is dragged under another summary node?

I think that I have to do this overriding the GanttDragDropBehavior.CanDrop() function but I can't find how to know when the DestinationSlot changes his parent node

Any help will be appreciated
Thanks in advance

 

Polya
Telerik team
 answered on 29 Mar 2017
1 answer
1.0K+ views

Hi Telerik,

I know binding the password should not be done due to the password being in the RAM is bad practice.

Now everything I want is to let the database tell me if there even is a password (I'm NOT loading the password/password hash) so I can set the Variable I was planning on binding to some garbage text (eg. ********) so the user is visually informed there has been a password set before.

What is a way I can archive this?

BTW: What is best practice to use/get the actual password the user entered to store it? Your examples and documentation on this topic are - as often - paper thin.

Thanks a lot

Kalin
Telerik team
 answered on 29 Mar 2017
2 answers
127 views

Let's say I have a very large (millions of records) DB of cars but one of the column (colors) has only a couple of different choices (red, green, blue, black, white).

When I'm binding the DB to the GridView (using pagination because I can't load the whole table at once and data virtualization is performing poorly on this amount of data) and trying to filter by color every time I open the filter editor I'm sending a query to my DB asking for Top 1000 Distinct colors which is really slow.

Now my question is, can I have a predefined list of available colors to use for my Filter Editor? Just create a List<String> and feed it to the editor?

Thank you.

Alex
Top achievements
Rank 1
 answered on 28 Mar 2017
1 answer
96 views

Hi,

I am using Mutliple selection mode along with RowDetails. And expanded the RowDetails manually using GridViewRow.MouseDoubleClick event. While clicking on DetailsPresenter the selection process is triggered automatically. Is there any option to cancel the selection when clicking on DetailsPresenter?

 

Thanks,

Antony

Dilyan Traykov
Telerik team
 answered on 28 Mar 2017
9 answers
361 views

Hello,

I have two radlistboxes in my user control.

I need on dragging to hide (make invisible) the item in source radlistbox and keep showing up the dragged item at the same time.

If I make the source item to be invisible, the dragged item is also becomes  invisible.

Is there any solution to this issue ?

This is the styles of radlistbox and radlistbox item I use :

    <Style x:Key="RadListBoxStyle1" TargetType="{x:Type telerik:RadListBox}">
        <Setter Property="telerik:ScrollingSettingsBehavior.IsEnabled" Value="True"/>
        <Setter Property="telerik:ScrollingSettingsBehavior.ScrollAreaPadding" Value="30"/>
        <Setter Property="telerik:ScrollingSettingsBehavior.ScrollStep" Value="24"/>
        <Setter Property="telerik:ScrollingSettingsBehavior.ScrollStepTime" Value="0:0:0.05"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Once"/>
        <Setter Property="BorderBrush" Value="#FF848484"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadListBox}">
                    <Grid>
                        <ScrollViewer x:Name="PART_ScrollViewer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" Margin="0" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
                            <telerik:StyleManager.Theme>
                                <telerik:Expression_DarkTheme/>
                            </telerik:StyleManager.Theme>
                            <ItemsPresenter/>
                        </ScrollViewer>
                        <ContentPresenter x:Name="PART_DropVisualPlaceholder" HorizontalAlignment="Stretch" Visibility="Collapsed" VerticalAlignment="Stretch"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

 

  <Style x:Key="CustomRadListBoxItemStyle" TargetType="telerik:RadListBoxItem">
        <Setter Property="Padding" Value="0" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="IsSelected" Value="{Binding IsSelected,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"/>
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="telerik:DragDropManager.AllowDrag" Value="True"/>
        <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"/>
        <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapDown"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadListBoxItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverVisual" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To="0.5" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="SelectedVisual" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <!-- normal-->
                        <Border CornerRadius="{StaticResource ControlOuterBorder_CornerRadius}" Margin="1 0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" />
                        <!-- Mouseover -->
                        <Border x:Name="MouseOverVisual" Opacity="0" 
                                CornerRadius="{StaticResource ControlOuterBorder_CornerRadius}" Margin="1 0" 
                                BorderBrush="{StaticResource ControlOuterBorder_Highlighted}" 
                                BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                            <Border Background="Transparent" BorderBrush="{StaticResource ControlInnerBorder_Highlighted}" BorderThickness="0" CornerRadius="{StaticResource ControlInnerBorder_CornerRadius}" SnapsToDevicePixels="True" />
                        </Border>
                        <!-- Selected -->
                        <Border x:Name="SelectedVisual" Opacity="0" CornerRadius="{StaticResource ControlOuterBorder_CornerRadius}" Margin="1 0" BorderBrush="{StaticResource ControlSubItem_OuterBorder_Selected}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                            <Border Background="Transparent" BorderBrush="{StaticResource ControlSubItem_InnerBorder_Selected}" BorderThickness="0" CornerRadius="{StaticResource ControlInnerBorder_CornerRadius}" SnapsToDevicePixels="True" />
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <!-- Focus -->
                        <Border x:Name="FocusVisual" Opacity="0" Margin="0 0" BorderThickness="0" CornerRadius="{StaticResource ControlOuterBorder_CornerRadius}" BorderBrush="{StaticResource ControlOuterBorder_Focused}" SnapsToDevicePixels="True" />
                        
                        
                    </Grid>
                    
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <!--<Style.Triggers>
            <DataTrigger Binding="{Binding  Path=IsItemEnable}" Value="True">
                <Setter Property="Visibility" Value="Visible" />
            </DataTrigger>
            <DataTrigger Binding="{Binding  Path=IsItemEnable}" Value="False">
                <Setter Property="Visibility" Value="Hidden" />
            </DataTrigger>
         
        </Style.Triggers>-->
    </Style>

Thank you,

Alex.S

Dilyan Traykov
Telerik team
 answered on 28 Mar 2017
4 answers
168 views

I would to use the RagDocking control as container of the views of my application as described in you documentation at the page 

http://docs.telerik.com/devtools/wpf/controls/raddocking/features/panes/panesource.html .

In my main windows xaml file I added the following lines:

<telerik:RadDocking PanesSource="{Binding Views}">
    <telerik:RadDocking.DockingPanesFactory>
      <telerik:DockingPanesFactory/>
    </telerik:RadDocking.DockingPanesFactory>
</telerik:RadDocking>

In my mainViewModel I added this code to add a new view using this code all works fine:

RadDocumentPane view = new RadDocumentPane()  { Header = "Customer" };
_views.Add(view);
RaisePropertyChanged(() => Views);
 

 

Now, I would to define the vews of my application in separated xaml files. I added a new UserControl to my project named view1 and I changed the view1.xaml file in this way

<telerik:RadDocumentPane x:Class="MyApp.Views.TestView"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300" Header="Test">
    <Grid>
        <TextBlock>Test</TextBlock
    </Grid>
</telerik:RadDocumentPane>

and the view1.cs file in this way

namespace MyApp.Views
{
    public partial class TestView : RadDocumentPane
    {
        public TestView()
        {
            InitializeComponent();
        }
    }
}

Then I changed the code to add a new in this way:

//RadDocumentPane view = new RadDocumentPane() { Header = "Customer" };
TestView view = new TestView();
_views.Add(view);
RaisePropertyChanged(() => Views);

With this changes, the new pane is added to the docking view but unfortunately without the header tab.

Is it possible to define de panes in separated xaml file as I done? Or have I to use the RadDocumentPane class and place my view in the Content property of the RadDocumentPane?

Thanks in advance

 

Kalin
Telerik team
 answered on 28 Mar 2017
1 answer
1.2K+ views

I have at WPF app with a main window using MVVM and EF.

In the MainView I have RadGridView with a GridViewComboBoxColumn that is bound to a  property on my model,

I would like to use it with a Enum when the user want to edit the value.

XAML in MainView

<Window>
    <UserControl.DataContext>
        <viewModel:MainViewModel/>
    </UserControl.DataContext>
    <Grid>
         <telerik:RadGridView ItemsSource="{Binding MyUserList}">
    <telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="ID"
                            DataMemberBinding="{Binding Id}"
IsReadOnly="True" />
<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding UseName}"
ItemsSource="{Binding AvailableUserNameEnum}"
                                UniqueName="UseTheName"
      </telerik:RadGridView.Columns>
      </telerik:RadGridView>
    </Grid>
 </Window>

Code in MainViewmodel

public enumUseNameEnum
{
   NA,
   No,
   Yes
}
public List<UseNameEnum> AvailableUseNameEnum { get; set; }
private void Fill AvailableUseNameEnums()
        {
            AvailableUseNameEnum = new List<UseNameEnum>
            {
                UseNameEnum.Yes,
UseNameEnum.No,
                UseNameEnum.NA
            };
        }
Data from the Table User is hold the this list, that is bound to the grid:
public ObservableCollection<Users> MyUserList { get; set; }

Table User has 2 Columns: ID  and UseName

The Grid shows data fine, except for the UseName Column, that is blank.  When clicked in the combobox , it has data , the 3 options,  but when one is selected the values is not showing in the cell. It is still blank.


Dilyan Traykov
Telerik team
 answered on 28 Mar 2017
2 answers
634 views

I have a Main form with a tab control where I am trapping the tab change event in the view model.

<i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <i:InvokeCommandAction Command="{Binding TabChanged}"
                             CommandParameter="{Binding ElementName=TCMain}" />
                </i:EventTrigger>
</i:Interaction.Triggers>

Note the element name

In my view model I successfully trap the event for processing relying on the name to identify the tab control

private void tabChanged(object o)
{
    if (o == null) { return; }
    if (o.GetType() == typeof(Telerik.Windows.Controls.RadTabControl))
    {
        if ((o as Telerik.Windows.Controls.RadTabControl).Name != "TCMain")
        {
            return;
        }
    }
}

One of the main window tab items also has a user control which has a tab control called UCTab, it has no tabchanged event processing.

When I change tabs on the UCTab the event on TCMain fires and the name passed to the event in the view model is the TCMain tab.

Is it possible to isolate the UCTab from the event processing.

(I have solved this by changing the UCTab to a standard MS tab control but it is very unsatisfactory).

I have a sample project to demonstrate the problem if required.

 

 

 

 

 

 

 

Mark
Top achievements
Rank 1
 answered on 28 Mar 2017
15 answers
431 views
Hi,

 

I'm developing a new feature with Schedule View, where  i need to add a drag & drop feature and allow merging two appointments if they are dragged over another.

Is it possible to acomplish that? I have an event - OnAppointmentSlotChanged - where I can re-schedule appointments, but how can i know if it is dragged over another appointment?

 

Thanks for any help that you can give,

Manuel

Yana
Telerik team
 answered on 28 Mar 2017
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?