or
<
Window
x:Class
=
"Login"
xmlns:systhreading
=
"clr-namespace:System.Threading;assembly=mscorlib"
xmlns:myNamespace
=
"clr-namespace:myNamespace"
xmlns:primatives
=
"clr-namespace:System.Windows.Controls.Primitives;assembly=PresentationFramework"
xmlns:sys
=
"clr-namespace:System;assembly=mscorlib"
Title
=
"Login"
Height
=
"768"
Width
=
"1024"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
Window.Resources
>
<
Style
TargetType
=
"Label"
>
<
Setter
Property
=
"Width"
Value
=
"100"
></
Setter
>
</
Style
>
<
Style
TargetType
=
"TextBox"
>
<
Setter
Property
=
"Width"
Value
=
"100"
></
Setter
>
</
Style
>
<
myNamespace:TestUser
x:Key
=
"testUser"
/
>
<
x:Array
x:Key
=
"PortValues"
Type
=
"sys:Int32"
>
<
sys:Int32
>1</
sys:Int32
>
<
sys:Int32
>2</
sys:Int32
>
<
sys:Int32
>3</
sys:Int32
>
<
sys:Int32
>4</
sys:Int32
>
<
sys:Int32
>5</
sys:Int32
>
<
sys:Int32
>6</
sys:Int32
>
<
sys:Int32
>7</
sys:Int32
>
<
sys:Int32
>8</
sys:Int32
>
<
sys:Int32
>9</
sys:Int32
>
<
sys:Int32
>10</
sys:Int32
>
<
sys:Int32
>11</
sys:Int32
>
<
sys:Int32
>12</
sys:Int32
>
<
sys:Int32
>13</
sys:Int32
>
<
sys:Int32
>14</
sys:Int32
>
<
sys:Int32
>15</
sys:Int32
>
<
sys:Int32
>16</
sys:Int32
>
</
x:Array
>
</
Window.Resources
>
<
DockPanel
DataContext
=
"{Binding Source={StaticResource testUser}}"
>
<
StackPanel
DockPanel.Dock
=
"Top"
VerticalAlignment
=
"Stretch"
HorizontalAlignment
=
"Center"
>
<
telerik:RadGridView
Name
=
"RadGridView1"
ItemsSource
=
"{Binding FooBars}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewComboBoxColumn
Header
=
"Something"
ItemsSource
=
"{Binding Source={StaticResource PortValues}}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
StackPanel
>
</
DockPanel
>
</
Window
>
Imports System.ComponentModel
Imports System.Collections.ObjectModel
Public Class TestUser
Private _fooBars As ObservableCollection(Of FooBar)
Public Property FooBars As ObservableCollection(Of FooBar)
Get
Return _fooBars
End Get
Set(ByVal value As ObservableCollection(Of FooBar))
_fooBars = value
End Set
End Property
Public Sub New()
_fooBars = New ObservableCollection(Of FooBar)
For i As Integer = 0 To 10
_fooBars.Add(New FooBar("FooBar" + i.ToString, i))
Next
End Sub
End Class
Public Class FooBar
Public Property Value As Integer
Public Property Name As String
Public Sub New(ByVal name As String, ByVal value As Integer)
Me.Value = value
Me.Name = name
End Sub
End Class
RadCalendar c =
new
RadCalendar();
c.FirstDayOfWeek =
null
;
See the method (RadCalendar.):
private
static
bool
IsValidFirstDayOfWeek(
object
value)
{
DayOfWeek? nullable = (DayOfWeek?) value;
return
(Enum.IsDefined(
typeof
(DayOfWeek), nullable) || !nullable.HasValue);
// ???
}
I getting "throw ArgumentNullException: Value cannot be null.Parameter name: value"
Maybe code change to:
private
static
bool
IsValidFirstDayOfWeek(
object
value)
{
DayOfWeek? nullable = (DayOfWeek?) value;
return
(!nullable.HasValue || Enum.IsDefined(
typeof
(DayOfWeek), nullable.Value));
}
Its really working without exceptions!