Hi,
I have a rad grid that I am putting into edit mode on row double click. This functionality works great until I put and InsertItemTemplate on any of the fields.
When I put an InsertItemTemplate on any of the fields and then double click the row to put it into edit mode I get the following javascript error.
Below is a stripped down version of my grid. Can you please take a look and tell me what I am doing wrong.
Thank you for you assistance.
Tracy
I have a rad grid that I am putting into edit mode on row double click. This functionality works great until I put and InsertItemTemplate on any of the fields.
When I put an InsertItemTemplate on any of the fields and then double click the row to put it into edit mode I get the following javascript error.
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
_endPostBack: function PageRequestManager$_endPostBack(error, executor, data) {
if (this._request === executor.get_webRequest()) {
this._processingRequest = false;
this._additionalInput = null;
this._request = null;
}
var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
if (error && !eventArgs.get_errorHandled()) {
throw error;
}
},
Below is a stripped down version of my grid. Can you please take a look and tell me what I am doing wrong.
Thank you for you assistance.
Tracy
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="QBF PRJ Forecasting Bak1.aspx.vb" Inherits="IPS_Gateway.QBF_PRJ_Forecasting_Bak1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
script
src
=
"../../Scripts/ControlSelectOnFocus.js"
type
=
"text/javascript"
></
script
>
<
script
type
=
"text/javascript"
>
function RowDblClick(sender, eventArgs) {
editedRow = eventArgs.get_itemIndexHierarchical();
$find("<%= rgvMainGrid.ClientID %>").get_masterTableView().editItem(editedRow);
}
function CancelEdit(sender, args) {
var c = confirm("Are you sure you want to cancel your changes>");
if (c == true) {
$find("<%= rgvMainGrid.ClientID %>").get_masterTableView().cancelAll();
}
}
function GridCommand(sender, args) {
if (args.get_commandName() != "Edit") {
editedRow = null;
}
}
</
script
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
act:ToolkitScriptManager
ID
=
"ToolkitScriptManager1"
runat
=
"server"
EnablePartialRendering
=
"true"
AsyncPostBackTimeOut
=
"600"
/>
<
telerik:RadWindowManager
ID
=
"rwmManager"
runat
=
"server"
></
telerik:RadWindowManager
>
<
asp:SqlDataSource
ID
=
"SQLDS_ForecastedCostEntry"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:IPSDataConnectionString %>" SelectCommandType="StoredProcedure" SelectCommand="[Project].[DSP_ForecastedHoursEntry-Sel]" />
<
asp:SqlDataSource
ID
=
"SQLDS_ForecastedCostUpdate"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:IPSDataConnectionString %>" SelectCommandType="StoredProcedure" SelectCommand="[Project].[DSP_ForecastedHoursEntry-Ins-Upd]" />
<
asp:panel
ID
=
"pnlPage"
runat
=
"server"
cssClass
=
"css_GPC01_Panel_MainContent"
>
<
wuc:PageHeader
id
=
"wucPageHeader"
runat
=
"server"
></
wuc:PageHeader
>
<
asp:Panel
ID
=
"pnlPageContent"
runat
=
"server"
cssClass
=
"css_GPC01_Panel_PageContent"
>
<
telerik:RadAjaxPanel
ID
=
"rapMainGrid"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"rgvMainGrid"
runat
=
"server"
DataSourceID
=
"SQLDS_ForecastedCostEntry"
EnableEmbeddedSkins
=
"true"
Skin
=
"Office2010Silver"
Height
=
"400px"
Width
=
"1230px"
EnableViewState
=
"true"
AutoGenerateColumns
=
"false"
AllowMultiRowSelection
=
"false"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"true"
AllowAutomaticUpdates
=
"true"
EnableLinqExpressions
=
"false"
EnableHeaderContextMenu
=
"true"
AllowFilteringByColumn
=
"false"
AllowPaging
=
"true"
PageSize
=
"1000"
>
<
HeaderStyle
Font-Bold
=
"true"
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
Wrap
=
"false"
font-size
=
"10px"
/>
<
ItemStyle
HorizontalAlign
=
"Right"
/>
<
AlternatingItemStyle
HorizontalAlign
=
"Right"
/>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"40px"
/>
<
PagerStyle
AlwaysVisible
=
"true"
Mode
=
"NextPrevNumericAndAdvanced"
/>
<
FooterStyle
HorizontalAlign
=
"Right"
/>
<
ClientSettings
AllowColumnsReorder
=
"true"
AllowDragToGroup
=
"false"
AllowColumnHide
=
"false"
ReorderColumnsOnClient
=
"true"
EnablePostBackOnRowClick
=
"false"
AllowExpandCollapse
=
"true"
EnableRowHoverStyle
=
"true"
>
<
ClientEvents
OnCommand
=
"GridCommand"
OnRowDblClick
=
"RowDblClick"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Resizing
AllowColumnResize
=
"True"
AllowRowResize
=
"False"
ResizeGridOnColumnResize
=
"false"
EnableRealTimeResize
=
"True"
></
Resizing
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
SaveScrollPosition
=
"true"
FrozenColumnsCount
=
"4"
/>
</
ClientSettings
>
<
MasterTableView
DataSourceID
=
"SQLDS_ForecastedCostEntry"
Name
=
"MasterGrid"
EnableViewState
=
"true"
ShowFooter
=
"true"
ShowGroupFooter
=
"true"
ShowHeadersWhenNoRecords
=
"true"
EditMode
=
"InPlace"
CommandItemDisplay
=
"Top"
TableLayout
=
"Fixed"
>
<
CommandItemTemplate
>
<
asp:Table
ID
=
"tblCommandTemplate"
runat
=
"server"
Width
=
"1230px"
CellSpacing
=
"0"
CellPadding
=
"0"
>
<
asp:TableRow
ID
=
"trowCommandTemplate1"
Height
=
"25px"
runat
=
"server"
style
=
"display:block;"
>
<
asp:TableCell
>
<
telerik:RadButton
ID
=
"rbtAdd"
runat
=
"server"
CommandName
=
"InitInsert"
Skin
=
"Transparent"
Text
=
"Add"
Icon-PrimaryIconURL="<%$ Resources:Images,AddRecord16%>" style="position:absolute;left:10px;font-size:12px;" ToolTip="Add New Record" />
<
telerik:RadButton
ID
=
"rbtCancel"
runat
=
"server"
OnClientClicked
=
"CancelEdit"
Skin
=
"Transparent"
Text
=
"Cancel"
Icon-PrimaryIconURL="<%$ Resources:Images,CancelRecord16%>" style="position:absolute;left:10px;font-size:12px;" ToolTip="Cancel Add/Edit" Visible='<%# rgvMainGrid.EditIndexes.Count > 0 Or rgvMainGrid.MasterTableView.IsItemInserted %>' AutoPostBack="false" />
<
telerik:RadButton
ID
=
"rbtSaveNew"
runat
=
"server"
CommandName
=
"PerformInsert"
Skin
=
"Transparent"
Text
=
"Save"
Icon-PrimaryIconURL="<%$ Resources:Images,SaveRecord16%>" style="position:absolute;left:80px;font-size:12px;" ToolTip="Save New Record" Visible='<%# rgvMainGrid.MasterTableView.IsItemInserted%>' />
<
telerik:RadButton
ID
=
"rbtSave"
runat
=
"server"
CommandName
=
"UpdateEdited"
Skin
=
"Transparent"
Text
=
"Save"
Icon-PrimaryIconURL="<%$ Resources:Images,SaveRecord16%>" style="position:absolute;left:80px;font-size:12px;" ToolTip="Save Edited Record" Visible='<%# rgvMainGrid.EditIndexes.Count > 0 AND Not rgvMainGrid.MasterTableView.IsItemInserted%>'/>
</
asp:TableCell
>
</
asp:TableRow
>
</
asp:Table
>
</
CommandItemTemplate
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Job"
UniqueName
=
"Job"
HeaderText
=
"Job"
/>
<
telerik:GridBoundColumn
UniqueName
=
"Extra"
DataField
=
"Extra"
Display
=
"true"
/>
<
telerik:GridBoundColumn
DataField
=
"CostCode"
UniqueName
=
"CostCode"
HeaderText
=
"Cost Code"
HeaderStyle-Width
=
"70px"
ItemStyle-HorizontalAlign
=
"Left"
ReadOnly
=
"true"
/>
<
telerik:GridTemplateColumn
UniqueName
=
"EmployeeName"
HeaderText
=
"EmployeeName"
DataField
=
"EmployeeName"
HeaderStyle-Width
=
"150px"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblEmployeeName"
runat
=
"server"
Text='<%# Bind("EmployeeName") %>' />
</
ItemTemplate
>
<
InsertItemTemplate
>
<
asp:TextBox
ID
=
"txtTest"
runat
=
"server"
/>
</
InsertItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
telerik:RadAjaxPanel
>
<
telerik:GridNumericColumnEditor
ID
=
"HrsEditor"
runat
=
"server"
>
</
telerik:GridNumericColumnEditor
>
</
asp:Panel
>
</
asp:panel
>
</
form
>
</
body
>
</
html
>