Hi!
I have the foloowing issue:
RadColorPicker can't load its client state (NullReferenceException) if CustomValidator validation fails.
Markup:
All this markup is in RadAjaxPanel.
The bug happens if CustomVaidator's check fails duirng item Insertion. During Item Editing it all works well.
A null reference exception happens when this bug taking place. Stack trace is below:
Thanks for your attention.
I have the foloowing issue:
RadColorPicker can't load its client state (NullReferenceException) if CustomValidator validation fails.
Markup:
<
Telerik:RadGrid
runat
=
"server"
ID
=
"statusesGrid"
OnNeedDataSource
=
"NeedStatusesDataSource"
OnDeleteCommand
=
"HandleDelete"
OnInsertCommand
=
"HandleInsert"
OnUpdateCommand
=
"HandleUpdate"
OnItemCommand
=
"HandleMakeDefault"
AutoGenerateColumns
=
"false"
Width
=
"100%"
>
<
MasterTableView
Name
=
"StatusesGrid"
EditMode
=
"InPlace"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"UnitTypeStatusId"
ClientDataKeyNames
=
"UnitTypeStatusId"
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"true"
AddNewRecordText
=
"Add new status"
ShowRefreshButton
=
"false"
/>
<
Columns
>
<
Telerik:GridEditCommandColumn
UniqueName
=
"Edit"
UpdateText
=
"Save"
InsertText
=
"Save"
CancelText
=
"Cancel"
ButtonType
=
"LinkButton"
/>
<
Telerik:GridBoundColumn
DataField
=
"UnitTypeStatusId"
UniqueName
=
"UnitTypeStatusId"
Display
=
"false"
/>
<
Telerik:GridTemplateColumn
UniqueName
=
"NameWithValidator"
DataField
=
"UnitTypeStatusName"
HeaderText
=
"Name"
>
<
InsertItemTemplate
>
<
Telerik:RadTextBox
runat
=
"server"
ID
=
"newNameBox"
Text='<%# Bind("UnitTypeStatusName") %>' />
<
DL:UnitTypeStatusNameValidator
runat
=
"server"
ID
=
"nameVaidator"
ForeColor
=
"Red"
UnitTypeIsCurrentObject
=
"true"
ThisStatusID
=
"0"
ControlToValidate
=
"newNameBox"
ValidateEmptyText
=
"true"
Display
=
"Static"
/>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
Telerik:RadTextBox
runat
=
"server"
ID
=
"nameEditBox"
Text='<%# Bind("UnitTypeStatusName") %>' />
<
DL:UnitTypeStatusNameValidator
runat
=
"server"
ID
=
"nameVaidator"
ForeColor
=
"Red"
UnitTypeIsCurrentObject
=
"true"
ThisStatusID='<%# Bind("UnitTypeStatusID") %>'
ControlToValidate="nameEditBox" ValidateEmptyText="true" Display="Static" />
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Literal
runat
=
"server"
Mode
=
"Encode"
Text='<%# Eval("UnitTypeStatusName") %>' />
</
ItemTemplate
>
</
Telerik:GridTemplateColumn
>
<
Telerik:GridTemplateColumn
DataField
=
"UnitTypeStatusColor"
UniqueName
=
"UnitTypeStatusColor"
HeaderText
=
"Color"
>
<
ItemTemplate
>
<
DL:ColorValueDisplay
runat
=
"server"
Value='<%# Eval("StatusColor") %>' />
</
ItemTemplate
>
<
EditItemTemplate
>
<
DL:ColorValueEditor
runat
=
"server"
ID
=
"colPicker"
HtmlColor='<%# Bind("UnitTypeStatusColor") %>' />
</
EditItemTemplate
>
<
InsertItemTemplate
>
<
DL:ColorValueEditor
runat
=
"server"
ID
=
"colPicker"
HtmlColor='<%# Bind("UnitTypeStatusColor") %>' />
</
InsertItemTemplate
>
</
Telerik:GridTemplateColumn
>
<
Telerik:GridCheckBoxColumn
UniqueName
=
"AllowUnitReshedule"
DataField
=
"AllowUnitReshedule"
DataType
=
"System.Boolean"
HeaderText
=
"Moveable"
/>
<
Telerik:GridButtonColumn
ButtonType
=
"LinkButton"
Text
=
"Make default"
UniqueName
=
"MakeDefault"
CommandName
=
"MakeDefault"
HeaderText
=
""
/>
<
Telerik:GridCheckBoxColumn
DataField
=
"DefaultStatus"
UniqueName
=
"DefaultStatus"
HeaderText
=
"Default"
ReadOnly
=
"true"
/>
<
Telerik:GridTemplateColumn
UniqueName
=
"Delete"
HeaderText
=
""
>
<
ItemTemplate
>
<
asp:MultiView
runat
=
"server"
ID
=
"view"
ActiveViewIndex="<%# GetViewIndexByDeletability(Container.DataItem) %>">
<
asp:View
runat
=
"server"
ID
=
"nonDelete"
>
<
span
title
=
"This status can't be deleted"
>Protected</
span
>
</
asp:View
>
<
asp:View
runat
=
"server"
ID
=
"delete"
>
<
a
href='javascript:OpenDeleteDialogForUnitTypeStatus(<%# Eval("UnitTypeStatusId") %>)'>Delete</
a
>
</
asp:View
>
</
asp:MultiView
>
</
ItemTemplate
>
<
EditItemTemplate
>
<!-- -->
</
EditItemTemplate
>
<
InsertItemTemplate
>
<!-- -->
</
InsertItemTemplate
>
</
Telerik:GridTemplateColumn
>
</
Columns
>
<
NoRecordsTemplate
>
No statuses defined for this unit type
</
NoRecordsTemplate
>
</
MasterTableView
>
</
Telerik:RadGrid
>
The bug happens if CustomVaidator's check fails duirng item Insertion. During Item Editing it all works well.
A null reference exception happens when this bug taking place. Stack trace is below:
at Telerik.Web.UI.RadColorPicker.LoadClientState(Dictionary`2 clientState)