or
2012-01-09 10:09:18,868 FATAL - User Interface : Unhandled Exception
System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
bij System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.ContextLayoutManager.fireAutomationEvents()
bij System.Windows.ContextLayoutManager.UpdateLayout()
bij System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
bij System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
bij System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
bij System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
bij System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
<
UserControl
x:Class
=
"BrabantWater.UI.Screens.ZInspectionListScreen"
xmlns:imageFactory
=
"clr-namespace:Sap.Eam.UI.Theme;assembly=CustomTheme_WPF"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Height
=
"auto"
Width
=
"auto"
>
<
UserControl.Resources
>
<
BooleanToVisibilityConverter
x:Key
=
"boolToVisConverter"
/>
<
DataTemplate
x:Key
=
"StatusButtons"
>
<
StackPanel
Orientation
=
"Horizontal"
Width
=
"110"
>
<
telerik:RadButton
Click
=
"RadButtonDelete_Click"
MinWidth
=
"50"
IsEnabled
=
"{Binding Path=IsDeletable, Mode=OneWay}"
>
<
Image
Source
=
"{Binding Path=DeleteImage, Mode=OneWay}"
Width
=
"32"
/>
</
telerik:RadButton
>
<
telerik:RadButton
Click
=
"RadButtonStatus_Click"
MinWidth
=
"50"
IsEnabled
=
"{Binding Path=IsEditable,Mode=OneWay}"
>
<
Image
Source
=
"{Binding Path=StatusImage, Mode=OneWay}"
Width
=
"32"
/>
</
telerik:RadButton
>
</
StackPanel
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"GridContainer"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
StackPanel
Grid.Row
=
"0"
Orientation
=
"Horizontal"
Margin
=
"5,5,5,5"
Height
=
"35"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Center"
>
<
telerik:RadButton
x:Name
=
"ButtonNewInstallation"
Content
=
"{lex:LocText Key=Inspection_New_Installation, Dict=InspectionResources, Assembly=Win32Resources}"
MinWidth
=
"100"
Click
=
"ButtonNewInstallation_Click"
/>
<
telerik:RadButton
x:Name
=
"ButtonNewDamage"
Content
=
"{lex:LocText Key=Inspection_New_Defect, Dict=InspectionResources, Assembly=Win32Resources}"
Margin
=
"10,0,0,0"
MinWidth
=
"100"
Click
=
"ButtonNewDamage_Click"
/>
</
StackPanel
>
<
telerik:RadGridView
x:Name
=
"InspectionGrid"
AlternationCount
=
"2"
AutoGenerateColumns
=
"False"
CanUserFreezeColumns
=
"False"
CanUserReorderColumns
=
"False"
ColumnWidth
=
"*"
EditTriggers
=
"None"
Grid.Row
=
"1"
Margin
=
"5"
MouseDoubleClick
=
"InspectionGrid_MouseDoubleClick"
RowIndicatorVisibility
=
"Collapsed"
SelectionChanged
=
"InspectionGrid_SelectionChanged"
SelectedItem
=
"{Binding Path=CurrentInspection, Mode=TwoWay}"
ShowGroupPanel
=
"false"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
UniqueName
=
"DamageCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Space, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=DamageCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ItemCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Part, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=ItemCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ItemDescription"
Header
=
"{lex:LocText Key=Inspection_Addition, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=ItemDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"CauseCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Task, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=CauseCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"TaskCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Finding, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=TaskCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ActivityCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Risk, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=ActivityCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewImageColumn
DataMemberBinding
=
"{Binding Path=AttachmentImage, Mode=OneWay}"
Header
=
"{lex:LocText Key=Inspection_Attachments, Dict=InspectionResources, Assembly=Win32Resources}"
ImageHeight
=
"32"
ImageWidth
=
"32"
IsFilterable
=
"False"
MaxWidth
=
"60"
MinWidth
=
"60"
/>
<
telerik:GridViewColumn
CellTemplate
=
"{StaticResource StatusButtons}"
IsFilterable
=
"False"
MaxWidth
=
"120"
MinWidth
=
"120"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
UserControl
>
The version of the Telerik WPF components being used: 2010.2.0716.35.
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
div
>
<
telerik:RadGrid
runat
=
"server"
AllowPaging
=
"True"
ID
=
"RadGrid2"
OnNeedDataSource
=
"RadGrid2_NeedDataSource"
Width
=
"600px"
PageSize
=
"8"
>
<
MasterTableView
Width
=
"100%"
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"Project Name"
DataField
=
"name"
></
telerik:GridBoundColumn
>
</
Columns
>
<
NoRecordsTemplate
>
<
div
style
=
"height: 30px; cursor: pointer;"
>
No items to view</
div
>
</
NoRecordsTemplate
>
<
PagerStyle
Mode
=
"NumericPages"
PageButtonCount
=
"4"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
</
form
>
Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Web.UI
Imports Telerik.Web.UI
Public Class bookmarks
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub RadGrid2_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid2.NeedDataSource
RadGrid2.DataSource = getBookMarks
End Sub
Private ReadOnly Property getBookMarks() As IList(Of project)
Get
Dim strSQL As String = "SELECT PROJ_NAME FROM [OPI_TIMESHEETS] o left outer join DCSC_PROJECT d on o.project_number = d.PROJ_NO "
Dim results As IList(Of project) = New List(Of project)()
Using connection As IDbConnection = DbProviderFactories.GetFactory("System.Data.SqlClient").CreateConnection()
connection.ConnectionString = ConfigurationManager.ConnectionStrings("projcentral").ConnectionString
Using command As IDbCommand = connection.CreateCommand()
command.CommandText = strSQL
connection.Open()
Try
Dim reader As IDataReader = command.ExecuteReader()
While reader.Read()
Dim name As String = reader.GetValue(reader.GetOrdinal("PROJ_NAME"))
results.Add(New project(name))
End While
Catch ex As SqlException
results.Clear()
'lblmsg.Text = ex.Message
End Try
End Using
End Using
lblMsg.Text = results.Count & " items in list"
Return results
End Get
End Property
Class project
Private _projName As String
Sub New(ByVal name As String)
_projName = name
End Sub
#Region "properties"
Private ReadOnly Property Name() As String
Get
Return _projName
End Get
End Property
#End Region
End Class
End Class