this.OfficesDataSource = new List<
OfficeName
>();
OfficeName o;
EmployeeName e;
this.OfficesDataSource.Add(o = new OfficeName("A"));
o.EmployeeNames.Add(e = new EmployeeName("X"));
o.EmployeeNames.Add(new EmployeeName("Y"));
this.OfficesDataSource.Add(o = new OfficeName("B"));
o.EmployeeNames.Add(new EmployeeName("Z"));
this.DataContext = this.OfficesDataSource;
<
Page.Resources
>
<
DataTemplate
x:Key
=
"Projects"
DataType
=
"{x:Type local:Project}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"/Images/Project.png"
Height
=
"20"
Margin
=
"0,0,8,0"
/>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
StackPanel
>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"Clients"
DataType
=
"{x:Type local:Client}"
ItemTemplate
=
"{StaticResource Projects}"
ItemsSource
=
"{Binding Projects}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"/Images/Client.png"
Height
=
"20"
Margin
=
"0,0,2,0"
/>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
<
Style
x:Key
=
"ItemContainerStyle"
TargetType
=
"{x:Type telerik:RadTreeViewItem}"
>
<
Setter
Property
=
"Template"
Value
=
"{StaticResource SavanetekTreeItem}"
/>
</
Style
>
</
Page.Resources
>
<
telerik:RadTreeView
x:Name
=
"RadTreeView1"
Grid.Row
=
"1"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Style
=
"{StaticResource SavanetekTreeViewStyle}"
ItemsSource
=
"{Binding ClientList}"
SelectedItem
=
"{Binding Path=SelectedObject, Mode=TwoWay}"
ItemTemplate
=
"{StaticResource Clients}"
ItemContainerStyle
=
"{StaticResource ItemContainerStyle}"
>
<
telerik:RadTreeView.ContextMenu
>
<
ContextMenu
>
<
MenuItem
Header
=
"New Client..."
Click
=
"MenuItemNewClientDetails_Click"
/>
<
MenuItem
Header
=
"New Project..."
Command
=
"{Binding NewProjectCommand}"
/>
<
Separator
/>
<
MenuItem
Header
=
"Edit..."
Click
=
"MenuItemEditClientDetails_Click"
/>
<
Separator
/>
<
MenuItem
Header
=
"Remove..."
/>
</
ContextMenu
>
</
telerik:RadTreeView.ContextMenu
>
</
telerik:RadTreeView
>
Public
Sub
Remove()
If
(IsProject(SelectedObject))
Then
DB.Projects.DeleteOnSubmit(SelectedObject)
SubmitChangesToDatabase()
ElseIf
(IsClient(SelectedObject))
Then
DB.Clients.DeleteOnSubmit(SelectedObject)
SubmitChangesToDatabase()
Else
End
If
RefreshClientList()
End
Sub
Private
_clientList
As
ObservableCollection(Of Client)
Public
Property
ClientList()
As
ObservableCollection(Of Client)
Get
Return
_clientList
End
Get
Set
(
ByVal
value
As
ObservableCollection(Of Client))
_clientList = value
OnPropertyChanged(
"ClientList"
)
End
Set
End
Property
Public
Sub
RefreshClientList()
ClientList =
New
ObservableCollection(Of Client)()
ClientList = ClientRepo.FindAll()
OnPropertyChanged(
"ClientList"
)
End
Sub
Hello,
I am really hoping that someone can help me. I am new to the Telerik controls and am having an issue with the saving of the layout of a RadDocking control when it is embedded within a RadTabControl's ContentTemplate.
I am saving the layout to a file so I can verify that it is being formatted correctly, however the SerializationTags are not getting output to the file.
Here is a snippet of the XAML to show that I am setting the SerializationTag for my RadDocumentPane:
<telerikNavigation:RadTabControl.ContentTemplate>
<DataTemplate>
<Grid>
<radDock:RadDocking x:Name="ResultDocuments" Background="Transparent"
<radDock:RadDocking.DocumentHost>
<radDock:RadSplitContainer SizeChanged="SplitContainer_SizeChanged" >
<radDock:RadPaneGroup Name="RadDocumentGroup" Background="Transparent"
radDock:RadDocking.SerializationTag="DocumentGroup">
<radDock:RadDocumentPane
DataContext="{Binding DataContext,ElementName=ResultDocuments}"
Margin="0,0,0,-5" Name="DocumentPane" Title="Documents"
radDock:RadDocking.SerializationTag="DocumentPane"
HorizontalContentAlignment="Left" CanUserClose="False">
Here is a snippet of the output file I am getting:
<
GridViewColumn
Header
=
"column 1"
>
<
GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
TextBox
x:Name
=
"txtcontent"
/>
</
DataTemplate
>
</
GridViewColumn.CellTemplate
>
</
GridViewColumn
>
DataTemplate celltemplate = column.CellTemplate;
ContentPresenter contentpresenter = ...
TextBox txtbox = (TextBox)celltemplate.FindName(
"txtcontent"
, contentpresenter);
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Any idea why are those thrown?
And also if I increase the density of the grid like the next line of code
this.dynamicLayer.ZoomGridList.Add(new ZoomGrid(2 << 13, 2 << 13, 13));
the number of the errors increases tremendously.
EDIT>> I looked more into the call stack and this is the error thrown
System.ArgumentOutOfRangeException occurred Message=The added or subtracted value results in an un-representable DateTime.
Parameter name: t
Source=mscorlib
ParamName=t
StackTrace:
at System.DateTime.op_Addition(DateTime d, TimeSpan t)
InnerException: