Everything I've described so far works perfectly. So here's where the trouble begins.
When it comes time to persist data back to the DB, in my ItemCommand for the RadGrid which receives the "Save" (from e.CommandName), I have a call to GridEditableItem.ExtractValues. This call to ExtractValues finds and pulls data for every other column (which is in edit mode at any rate), except for my GridTemplateColumn! As described above, this is the column where I am dynamically instantiating and adding a control.
If I perform the instantiation and addition earlier as a test (e.g. Page_Init), then of course the control is found - but my condition which is based on data is not yet available. In other words, even though I would love to build the grid programmatically in Page_Init, I can't do so because I don't know what kind of control I need to instantiate that early!
Ideas please? Regards,
Allen
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="menu.aspx.vb" Inherits="TestaTredjepartWeb.menu" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"s"
runat
=
"server"
>
</
asp:ScriptManager
>
<
div
>
<
table
>
<
tr
>
<
td
>
<
telerik:RadMenu
ID
=
"menu"
runat
=
"server"
RenderMode
=
"Lightweight"
ClickToOpen
=
"true"
ExpandDelay
=
"1000"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Test1"
Value
=
"item1"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"1"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"2"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"22"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"23"
></
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"3"
></
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Test2"
Value
=
"item2"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"1"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"2"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"3"
></
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
form
>
</
body
>
</
html
>
You might think that this doesn't happen often, but for some users it actually does.
One other thing is that I think the second click should open it directly without waiting for the expandelay...
Regards
Andreas
<
asp:LinkButton
ID
=
"lnkAddProduct"
CausesValidation
=
"true"
ValidationGroup
=
"ValidationGroup2"
ToolTip
=
"Add To Cart"
runat
=
"server"
CommandArgument='<%# Eval ( "PriceListID").ToString() %>'
CommandName="addproduct"><
img
style
=
"border:0px"
alt
=
""
width
=
"22px"
height
=
"22px"
src
=
"../Images/icons/shopcartapply3.ico"
/> </
asp:LinkButton
>
<
asp:ImageButton
ImageUrl
=
"Images/zoom-search-2-icon.png"
AlternateText
=
"Search"
ToolTip
=
"Search"
Height
=
"32"
Width
=
"32"
runat
=
"server"
CssClass
=
"iconImageStyle"
OnClientClick
=
"Search_Click()"
/>
<
telerik:RadSearchBox
ID
=
"CmbBx_Search"
runat
=
"server"
Width
=
"550px"
EmptyMessage
=
"Search..."
OnClientSearch
=
"PerformSearch"
ShowSearchButton
=
"true"
>
<
DropDownSettings
Height
=
"400"
Width
=
"300"
/>
<
WebServiceSettings
Path
=
"Main.aspx"
Method
=
"GetResults"
/>
</
telerik:RadSearchBox
>
<
script
type
=
'text/javascript'
>
function Search_Click() {
toggle_visibility('CmbBx_Search');
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if (e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
</
script
>