Hello,
I am trying to remove a RadDocumentPane from a region when its closed, but I cant find a way to catch the close event in my viewmodel?
Whats the best approach to accomplished this with the Docking control?
Marcel
It's Telerik UI for WPF 2014.3.1202.40.
There is a RadCartesianChart on screen. Once user clicks on outside region of the chart, the track ball disappears due to losing keyboard focus.
Is it possible to keep the track ball inside chart in this case? It still has logical focus anyway.
Thanks.
Say I have a Diagram that is 1920x1080. I call ExportToImage with an enclosingBounds of (0, 0, 1920, 1080), a returnImageSize of (1920,1080), and a dpi of 384.
I get an image that is 7680 x 4320. Is that expected? I am (perhaps naively) expecting to get an image that is 1920x1080, based on the value of the returnImageSize parameter.
Thanks!
-David
We are using the TextControl (http://www.textcontrol.com) in an WinForms application used by more then 40.000 employees.
Now we are migrating the application to WPF.
We realize a problem on HD Displays, where standard build-in dialogs like Search and Replace, Spellchecker, Font Format dialogs etc. are too small - maybe because standard MVC dialogs are still used.
What about the Telerik RichTextBox control?
Are all Build-In dialogs scaling on HD-Displays correctly?
Hi,
I tried to implement the MouseLeftButtonDown event and the CellDoubleClick event on a style:
<
Style
TargetType
=
"{x:Type telerik:GridViewHeaderCell}"
>
<
Setter
Property
=
"Foreground"
Value
=
"White"
/>
<
EventSetter
Event
=
"CellDoubleClick"
Handler
=
"SelectDeselectColumn"
/>
<
EventSetter
Event
=
"MouseLeftButtonDown "
Handler
=
"SelectDeselectColumn2"
/>
</
Style
>
The "CellDoubleClick" event works fine but the "MouseLeftButtonDown" event doesn't work! I tried each event alone in the style and the MouseLeftButtonDown never works!
In the class "GridViewHeaderCell" there is no event accessible for MouseLeftButtonDown, there is only a method called "OnMouseLeftButtonDown" My guess is that the event MouseLeftButtonDown (or MouseDown) is already handled somewhere else...
If I want to use the method "OnMouseLeftButtonDown" I have to create a new child class that the parent is "GridViewHeaderCell". But I don't know where to allocate the new class in the code. Is there a event like "AutogeneratingCoumn"?
Is there any other options possible to support the MouseLeftButtonDown event or a single click?
I'm looking for a way for an autogenerated propertygrid checkbox item to disable (IsReadOnly/ReadOnlyEditorState) other items in the grid.
Is there an event or a isSelected for the generated checkbox available somehow?
Thank you,
Garrick
I have a bread-crumb, i make a control-template for this bread-crumb
(i do it automatic in the blend- "EditTemplate"->"Edit a copy")
the problem:
when i used this template my history pop-up is always empty, (the history in the model - correct, but on the view its empty!).
thenk you for helping!
the template code:
<ControlTemplate x:Key="RadBreadcrumbControlTemplate1" TargetType="{x:Type telerik:RadBreadcrumb}">
<Grid x:Name="outerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="3"/>
<Image x:Name="image" Margin="5,0" Source="{Binding CurrentContainer.Image, RelativeSource={RelativeSource TemplatedParent}}">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="MaxHeight" Value="16"/>
<Setter Property="MaxWidth" Value="16"/>
</Style>
</Image.Style>
<Image.Visibility>
<Binding Path="IsCurrentIconVisible" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:BooleanToVisibilityConverter/>
</Binding.Converter>
</Binding>
</Image.Visibility>
</Image>
<Breadcrumb:RadBreadcrumbBar x:Name="BreadcrumbBar" Grid.Column="1" Foreground="{TemplateBinding Foreground}" ItemTemplate="{TemplateBinding ItemTemplate}"/>
<telerik:RadSplitButton x:Name="historySplitButton" Grid.ColumnSpan="2" Grid.Column="1" InnerCornerRadius="0">
<telerik:RadSplitButton.DropDownContent>
<ListBox x:Name="HistoryListBox" BorderThickness="0" HorizontalContentAlignment="Stretch" Padding="2">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</telerik:RadSplitButton.DropDownContent>
<telerik:RadSplitButton.Style>
<Style TargetType="{x:Type telerik:RadSplitButton}">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="IsOpen" Value="False"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadSplitButton}">
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadToggleButton x:Name="DropDownPart" Grid.Column="1" IsTabStop="False" IsChecked="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" InnerCornerRadius="0" Margin="0,-1,0,0" MinWidth="11" MinHeight="7" Grid.Row="2" Style="{TemplateBinding TogglePartStyle}" Visibility="{TemplateBinding DropDownIndicatorVisibility}"/>
<telerik:RadButton x:Name="ButtonPart" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" InnerCornerRadius="0" Padding="{TemplateBinding Padding}" Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadButton}">
<ContentPresenter x:Name="Content" Grid.ColumnSpan="2" Content="{TemplateBinding Content}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadButton.Style>
<telerik:RadButton.Visibility>
<Binding Mode="TwoWay" Path="IsButtonPartVisible" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:BooleanToVisibilityConverter/>
</Binding.Converter>
</Binding>
</telerik:RadButton.Visibility>
</telerik:RadButton>
</Grid>
<Popup x:Name="DropDownPopup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" StaysOpen="False">
<Grid>
<Border x:Name="DropDownPopupBorder" BorderBrush="#FF848484" BorderThickness="1" Background="White" CornerRadius="0" Height="{TemplateBinding DropDownHeight}" MaxWidth="{TemplateBinding DropDownMaxWidth}" MaxHeight="{TemplateBinding DropDownMaxHeight}" Margin="0" MinWidth="3" MinHeight="3" Width="{TemplateBinding DropDownWidth}">
<ContentPresenter x:Name="DropDownPopupContent" ContentTemplate="{TemplateBinding DropDownContentTemplate}" Content="{TemplateBinding DropDownContent}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False"/>
<Trigger Property="IsOpen" Value="True">
<Setter Property="Panel.ZIndex" TargetName="DropDownPart" Value="1"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="DropDownButtonPosition" Value="Right">
<Setter Property="Grid.Column" TargetName="DropDownPart" Value="2"/>
<Setter Property="Grid.Row" TargetName="DropDownPart" Value="1"/>
<Setter Property="Margin" TargetName="DropDownPart" Value="-1,0,0,0"/>
</Trigger>
<Trigger Property="IsButtonPartVisible" Value="False">
<Setter Property="Grid.Column" TargetName="DropDownPart" Value="0"/>
<Setter Property="Grid.ColumnSpan" TargetName="DropDownPart" Value="3"/>
<Setter Property="IsTabStop" TargetName="DropDownPart" Value="True"/>
</Trigger>
<Trigger Property="IsFocused" Value="True"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadSplitButton.Style>
<TextBox x:Name="pathTextBox" BorderThickness="0" Margin="1" MinHeight="20">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</TextBox>
</telerik:RadSplitButton>
<Popup x:Name="AutocompletePopup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsAutocompleteOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" StaysOpen="False">
<ListBox x:Name="AutoCompleteListBox" BorderBrush="#FF848484" BorderThickness="1" MaxWidth="650" MaxHeight="500" MinWidth="100" MinHeight="30">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Popup>
<telerik:RadToggleButton x:Name="historyToggle" BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Command="Breadcrumb:RadBreadcrumbCommands.HistoryDropDown" InnerCornerRadius="0" Width="15">
<Path x:Name="DropDownIndicator" Data="M0,0L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0z" Fill="Black" HorizontalAlignment="Center" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
</telerik:RadToggleButton>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsTextMode" Value="True">
<Setter Property="Visibility" TargetName="historySplitButton" Value="Visible"/>
<Setter Property="Visibility" TargetName="BreadcrumbBar" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="historyToggle" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsTextMode" Value="False">
<Setter Property="Visibility" TargetName="historySplitButton" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="BreadcrumbBar" Value="Visible"/>
<Setter Property="Visibility" TargetName="historyToggle" Value="Visible"/>
<Setter Property="IsChecked" TargetName="historyToggle" Value="False"/>
</Trigger>
<Trigger Property="IsAutocompleteOpen" Value="True">
<Setter Property="Panel.ZIndex" TargetName="historySplitButton" Value="1"/>
</Trigger>
<Trigger Property="IsTextModeEnabled" Value="False">
<Setter Property="Visibility" TargetName="historyToggle" Value="Collapsed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Following your Serialize a Databound Diagram article
I was wondering whether the RadDiagram Serialization/Deserialization system supports serialization of a collection within the GraphSource Nodes. In particular I am interested on using an ObservableCollection:
01.
public
class
OrgItem : HierarchicalNodeViewModel
02.
{
03.
public
OrgItem()
04.
{
05.
this
.MyCollection =
new
ObservableCollection<
string
>();
06.
}
07.
public
ObservableCollection<
string
> MyCollection
08.
{
09.
get
;
10.
}
11.
…
12.
…
13.
…
14.
}
15.
private
void
BindGraphSource()
16.
{
17.
int
uniqueIdCounter = 0;
18.
GraphSource source =
new
GraphSource();
19.
OrgItem rootItem =
new
OrgItem()
20.
{
21.
Title =
"CEO"
,
22.
Position =
new
Point(200, 20),
23.
Id = (uniqueIdCounter++).ToString()
24.
};
25.
rootItem.MyCollection.Add(
new
MyClass(“Test1”));
26.
rootItem.MyCollection.Add(
new
MyClass(“Test2”));
27.
source.AddNode(rootItem);
28.
…
29.
…
30.
…
31.
}
32.
public
class
MyClass
33.
{
34.
public
MyClass(){};
35.
public
MyClass(
string
myValue)
36.
{
37.
this
.MyValue = myValue;
38.
}
39.
public
string
MyValue {
get
;
set
; }
40.
}
Could I possibly Serialize/Deserialize the ObservableCollection in the OrgItem?
If that is possible how should i serialize/deserialize the collection in the GraphSource?
01.
public
class
GraphSource : SerializableGraphSourceBase<OrgItem, OrgLink>
02.
{
03.
public
override
string
GetNodeUniqueId(OrgItem node)
04.
{
05.
return
node.Id;
06.
}
07.
public
override
void
SerializeNode(OrgItem node,
08.
Telerik.Windows.Diagrams.Core.SerializationInfo info)
09.
{
10.
base
.SerializeNode(node, info);
11.
info[
"Title"
] = node.Title;
12.
}
13.
public
override
OrgItem DeserializeNode(
14.
Telerik.Windows.Diagrams.Core.IShape shape,
15.
Telerik.Windows.Diagrams.Core.SerializationInfo info)
16.
{
17.
base
.DeserializeNode(shape, info);
18.
if
(info[
"Title"
] !=
null
)
19.
{
20.
return
new
OrgItem(info[
"Title"
].ToString());
21.
}
22.
return
null
;
23.
}
24.
}
Many thanks in advance,
Christos