or
<
telerik:RadTabStrip
ID
=
"radTSCapabilities"
runat
=
"server"
SelectedIndex
=
"0"
Skin
=
"Default"
MultiPageID
=
"radMPCapabilities"
/>
<
telerik:RadMultiPage
ID
=
"radMPCapabilities"
runat
=
"server"
SelectedIndex
=
"0"
/>
Telerik.Web.UI.RadPageView tmpPageView =
new
Telerik.Web.UI.RadPageView();
tmpPageView.ID = type.AbilityType.Name;
radMPCapabilities.PageViews.Add(tmpPageView);
//Add a Tab for the AbilityType
Telerik.Web.UI.RadTab tmpTab =
new
Telerik.Web.UI.RadTab(type.AbilityType.Name, type.AbilityType.ID.ToString());
tmpTab.PageViewID = tmpPageView.ID;
radTSCapabilities.Tabs.Add(tmpTab);
//Create and Load the Rad Tree
Telerik.Web.UI.RadTreeView radTree =
new
Telerik.Web.UI.RadTreeView();
radTree.Skin =
"Default"
;
radTree.CheckBoxes =
true
;
radTree.TriStateCheckBoxes =
true
;
radTree.CheckChildNodes =
true
;
radTree.NodeDataBound +=
new
Telerik.Web.UI.RadTreeViewEventHandler(radTree_NodeDataBound);
radTree.ID = type.AbilityType.ID.ToString() + type.AbilityType.Name.Replace(
" "
,
"_"
);
radTree.DataTextField =
"Name"
;
radTree.DataValueField =
"ID"
;
radTree.DataFieldID =
"ID"
;
radTree.DataFieldParentID =
"ParentID"
;
//If there are multiple Ability Types in result set then go to the DB to get all Abilities for that type
if
(distinctAbilityTypes.Count() != 1)
radTree.DataSource = AbilityMgr.GetAbilitiesByAbilityTypeID(type.AbilityType.ID);
else
radTree.DataSource = tmpAbilities;
//Bind the Tree
radTree.DataBind();
//Add a top border
Literal tmpLiteral =
new
Literal();
tmpLiteral.Text =
"<div style='border-top:solid 1px #AAAAAA;'></div>"
;
//Add the Literal and Tree to the associated PageView
radMPCapabilities.FindControl(type.AbilityType.Name).Controls.Add(tmpLiteral);
radMPCapabilities.FindControl(type.AbilityType.Name).Controls.Add(radTree);
System.Reflection.TargetInvocationException was unhandled
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method,
Object
target,
Object
[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method,
Object
target,
Object
[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(
Object
obj, BindingFlags invokeAttr, Binder binder,
Object
[] parameters, CultureInfo culture,
Boolean
skipVisibilityChecks)
at System.
Delegate
.DynamicInvokeImpl(
Object
[] args)
at System.
Delegate
.DynamicInvoke(
Object
[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(
Object
obj)
at System.Threading.ExecutionContext.runTryCode(
Object
userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode,
Object
userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback,
Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback,
Object
state,
Boolean
ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback,
Object
state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(
String
[] commandLine)
at RMS.My.MyApplication.Main(
String
[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
InnerException: System.NullReferenceException
Message=
Object
reference not set to an instance of an object.
Source=Telerik.WinControls.GridView
StackTrace:
at Telerik.WinControls.UI.ScrollableRowsContainerElement.RemoveElement(Int32 position)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.RowsContainerElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureView(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.GridTableElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)
InnerException:
Private
Sub
RadGridView1_CellEditorInitialized(sender
As
Object
, e
As
Telerik.WinControls.UI.GridViewCellEventArgs)
Handles
RadGridView1.CellEditorInitialized
Try
Dim
editor
As
Telerik.WinControls.UI.RadMultiColumnComboBoxElement = TryCast(e.ActiveEditor, Telerik.WinControls.UI.RadMultiColumnComboBoxElement)
If
editor IsNot
Nothing
AndAlso
editor.Columns IsNot
Nothing
Then
With
editor
If
.ValueMember =
"pkPostID"
Then
.Columns(
"pkPostID"
).IsVisible =
False
.Columns(
"tPostUPN"
).HeaderText =
"UPN"
.Columns(
"tJobTitleName"
).HeaderText =
"Job Title"
.Columns(
"dtPostStart"
).HeaderText =
"Start Date"
.Columns(
"dtPostEnd"
).HeaderText =
"End Date"
ElseIf
.ValueMember =
"pkEmployeeID"
Then
.Columns(
"pkEmployeeID"
).IsVisible =
False
.Columns(
"lEmployeeNumber"
).HeaderText =
"Emp Num"
.Columns(
"tEmployeeFirstName"
).HeaderText =
"First Name"
.Columns(
"tEmployeeLastName"
).HeaderText =
"Last Name"
End
If
.AutoSizeDropDownToBestFit =
True
.AutoFilter =
True
RemoveHandler
editor.TextChanged,
AddressOf
editor_TextChanged
AddHandler
editor.TextChanged,
AddressOf
editor_TextChanged
End
With
End
If
Catch
ex
As
Exception
Call
MessageBox.Show(ex.Message)
End
Try
End
Sub
Private
Sub
editor_TextChanged(sender
As
Object
, e
As
System.EventArgs)
Try
Dim
editor
As
Telerik.WinControls.UI.RadMultiColumnComboBoxElement =
DirectCast
(
Me
.RadGridView1.ActiveEditor, Telerik.WinControls.UI.RadMultiColumnComboBoxElement)
With
editor
If
.ValueMember =
"pkPostID"
Then
With
.EditorControl
With
.MasterTemplate.FilterDescriptors
.Remove(
"filterUPN"
)
.Add(
"filterUPN"
, Telerik.WinControls.Data.FilterOperator.IsEqualTo, editor.Value)
End
With
.TableElement.Update(Telerik.WinControls.UI.GridUINotifyAction.FilteringChanged)
End
With
ElseIf
.ValueMember =
"pkEmployeeID"
Then
With
.EditorControl
With
.MasterTemplate.FilterDescriptors
.Remove(
"filterEmpNum"
)
.Add(
"filterEmpNum"
, Telerik.WinControls.Data.FilterOperator.IsEqualTo, editor.Value)
End
With
.TableElement.Update(Telerik.WinControls.UI.GridUINotifyAction.FilteringChanged)
End
With
End
If
End
With
Catch
ex
As
Exception
Call
MessageBox.Show(ex.Message)
End
Try
End
Sub