ok, this error happens on export to excel from my radgrid. I got everything working fine in it and then they wanted me to put on a looker service with a pop-up panel. Since then it breaks, the export to excel, if I take out the code it works fine, i do not want it exported to excel.
it breaks on the follwoing line which is part of the radgri_ItemCreated
pce.BehaviorID = behaviorID
How can I get around this to export the grid without the control
added peices to grid
it breaks on the follwoing line which is part of the radgri_ItemCreated
pce.BehaviorID = behaviorID
How can I get around this to export the grid without the control
added peices to grid
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
asp:Image
ID
=
"imgLooker"
runat
=
"server"
ImageUrl
=
"~/Images/ViewResources.gif"
ImageAlign
=
"Middle"
BorderStyle
=
"None"
/>
<
asp:PopupControlExtender
ID
=
"popInfo"
runat
=
"server"
PopupControlID
=
"pnlPop"
TargetControlID
=
"imgLooker"
DynamicContextKey='<% #Eval("intRecId") %>'
DynamicControlID="pnlpop" DynamicServiceMethod="HelloWorld" Position="bottom"></
asp:PopupControlExtender
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Protected Sub myRadGrid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemCreated
If TypeOf e.Item Is GridCommandItem Then
ScriptManager.GetCurrent(Page).RegisterPostBackControl(e.Item.FindControl("btnExport"))
End If
If TypeOf e.Item Is GridDataItem Then
Dim pce As PopupControlExtender = TryCast(e.Item.FindControl("popInfo"), PopupControlExtender)
Dim behaviorID As String = "pce_" + e.Item.RowIndex.ToString
pce.BehaviorID = behaviorID
Dim img As Image = DirectCast(e.Item.FindControl("imgLooker"), Image)
Dim OnMouseOverScript As String = String.Format("$find('{0}').showPopup();", behaviorID)
Dim OnMouseOutScript As String = String.Format("$find('{0}').hidePopup();", behaviorID)
img.Attributes.Add("onmouseover", OnMouseOverScript)
img.Attributes.Add("onmouseout", OnMouseOutScript)
End If
End Sub
FUll Grid layout
<
telerik:RadGrid
ID
=
"myRadGrid"
runat
=
"server"
Width
=
"98%"
BorderWidth
=
"1px"
CellPadding
=
"6"
GridLines
=
"None"
BorderColor
=
"#404040"
Skin
=
"Web20"
ShowFooter
=
"true"
>
<
ExportSettings
HideStructureColumns
=
"true"
ExportOnlyData
=
"true"
IgnorePaging
=
"true"
OpenInNewWindow
=
"true"
FileName
=
"Inventory"
></
ExportSettings
>
<
MasterTableView
AutoGenerateColumns
=
"false"
DataKeyNames
=
"intRecId"
Name
=
"MasterGrid"
BorderColor
=
"#404040"
Font-Size
=
"9"
Font-Names
=
"Veranda,arial,sans-serif"
HeaderStyle-HorizontalAlign
=
"Center"
GridLines
=
"Both"
BorderWidth
=
"1px"
CommandItemDisplay
=
"Top"
HierarchyLoadMode
=
"ServerBind"
AllowPaging
=
"true"
PageSize
=
"20"
PagerStyle-Mode
=
"NumericPages"
><
ItemStyle
HorizontalAlign
=
"Center"
/>
<
AlternatingItemStyle
BackColor
=
"#B0C4DE"
HorizontalAlign
=
"Center"
/><
HeaderStyle
ForeColor
=
"White"
Font-Bold
=
"true"
BorderColor
=
"#404040"
BorderWidth
=
"1px"
/>
<
CommandItemTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
align
=
"right"
><
asp:Button
ID
=
"btnExport"
runat
=
"server"
CommandName
=
"ExportToExcel"
Text
=
"Export Excel"
/></
td
>
</
tr
>
</
table
>
</
CommandItemTemplate
>
<
Columns
>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
asp:Image
ID
=
"imgLooker"
runat
=
"server"
ImageUrl
=
"~/Images/ViewResources.gif"
ImageAlign
=
"Middle"
BorderStyle
=
"None"
/>
<
asp:PopupControlExtender
ID
=
"popInfo"
runat
=
"server"
PopupControlID
=
"pnlPop"
TargetControlID
=
"imgLooker"
DynamicContextKey='<% #Eval("intRecId") %>'
DynamicControlID="pnlpop" DynamicServiceMethod="HelloWorld" Position="bottom"></
asp:PopupControlExtender
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
></
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"strCategory"
HeaderText
=
"CATEGORY"
/>
<
telerik:GridBoundColumn
DataField
=
"strManufacturer"
HeaderText
=
"MANUFACTURER"
/>
<
telerik:GridBoundColumn
DataField
=
"strmake"
HeaderText
=
"MAKE"
/>
<
telerik:GridBoundColumn
DataField
=
"strPoNum"
HeaderText
=
"PO #"
/>
<
telerik:GridBoundColumn
DataField
=
"strAssetNum"
HeaderText
=
"ASSET #"
/>
<
telerik:GridBoundColumn
DataField
=
"strSN"
HeaderText
=
"SN"
/>
<
telerik:GridBoundColumn
DataField
=
"fltCost"
HeaderText
=
"COST"
/>
<
telerik:GridBoundColumn
DataField
=
"FUND"
HeaderText
=
"FUND"
/>
<
telerik:GridBoundColumn
DataField
=
"ws"
HeaderText
=
"WTY_START"
/>
<
telerik:GridBoundColumn
DataField
=
"we"
HeaderText
=
"WTY_END"
/>
<
telerik:GridBoundColumn
DataField
=
"QTY"
HeaderText
=
"QTY"
/>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
style
=
"height:8px"
></
td
>
</
tr
>
<
tr
>
<
td
><
b
>EDIT DETAILS</
b
></
td
>
</
tr
>
</
table
>
<
table
width
=
"100%"
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Enter PO </
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:TextBox
ID
=
"txtPoNum"
runat
=
"server"
Width
=
"160px"
Text='<%# Bind("strPoNum") %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Enter AssetTag </
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:TextBox
ID
=
"txtAssetNum"
runat
=
"server"
Width
=
"160px"
Text='<%# Bind("strAssetNum") %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Enter SN </
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:TextBox
ID
=
"txtSn"
runat
=
"server"
Width
=
"160px"
Text='<%# Bind("strSN") %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Enter Cost </
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:TextBox
ID
=
"txtCost"
runat
=
"server"
Width
=
"160px"
Text='<%# Bind("fltCost") %>'></
asp:TextBox
>
<
asp:FilteredTextBoxExtender
ID
=
"txtCost_FTE"
runat
=
"server"
Enabled
=
"True"
TargetControlID
=
"txtCost"
ValidChars
=
"."
FilterType
=
"Custom, Numbers"
/>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Warranty Start </
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:TextBox
ID
=
"txtWStart"
runat
=
"server"
style
=
"cursor:pointer; margin-right: 0px;"
Width
=
"160px"
Text='<%# Bind("ws") %>'></
asp:TextBox
>
<
asp:CalendarExtender
ID
=
"txtWStart_CE"
runat
=
"server"
Enabled
=
"True"
TargetControlID
=
"txtWStart"
></
asp:CalendarExtender
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Warranty End </
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:TextBox
ID
=
"txtWEnd"
runat
=
"server"
style
=
"cursor:pointer; margin-right: 0px;"
Width
=
"160px"
Text='<%# Bind("we") %>'></
asp:TextBox
>
<
asp:CalendarExtender
ID
=
"txtWEnd_CE"
runat
=
"server"
Enabled
=
"True"
TargetControlID
=
"txtWEnd"
></
asp:CalendarExtender
>
</
td
>
</
tr
>
</
table
>
<
table
width
=
"100%"
>
<
tr
>
<
td
>
<
asp:LinkButton
ID
=
"lnkSubmit"
runat
=
"server"
text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"lnkCancel"
runat
=
"server"
CausesValidation
=
"false"
CommandName
=
"Cancel"
Text
=
"Cancel"
></
asp:LinkButton
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:8px"
></
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>