| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> | |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head id="Head1" runat="server"> | |
| <title>Untitled Page</title> | |
| <style type="text/css"> | |
| html, body, form | |
| { | |
| height: 100%; | |
| overflow: hidden; | |
| margin: 0px; | |
| padding: 0px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <div id="header" style="height:100px;background-color:Gray;">Header</div> | |
| <rad:radscriptmanager runat="server"></rad:radscriptmanager> | |
| <rad:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%" | |
| HeightOffset="200"> | |
| <rad:RadPane ID="SideNav" runat="server" width="180" MinWidth="180"></rad:RadPane> | |
| <rad:RadSplitBar id="VerticalSplitBar" runat="server" CollapseMode="Forward" /> | |
| <rad:RadPane ID="RadPane2" runat="server"> | |
| </rad:RadPane> | |
| </rad:RadSplitter> | |
| <div id="footer" style="height:100px;background-color:Gray;">Footer</div> | |
| </form> | |
| </body> | |
| </html> |
| function rdlKeyPressing(sender, eventArgs) { |
| if (eventArgs.get_domEvent().keyCode == 8) { |
| sender._markFirstMatch = false; //This allows users to enter values not in combo, but shortened versions of existing items. |
| } else { |
| sender._markFirstMatch = true; |
| } |
| } |
function
openRadMenu(menuId)
{
var oRadMenu = $find(menuId);
oRadMenu.get_items().getItem(0).click();
}
The menu opens but it is closed again at once. It does not stay open.
The menu looks like this:
</a>
<telerik:RadMenu ClickToOpen ="true" ID="RadMenu1" runat="server" Skin="Office2007" EnableEmbeddedSkins ="true" >
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
<Items>
<telerik:RadMenuItem text="Apa">
<Items>
<telerik:RadMenuItem Text="Mission Statement">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="Strategic Plan">
</telerik:RadMenuItem>
</Items>
</telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
I have also tried with oRadMenu.get_items().getItem(0).click();

Below is my grid, I don't know why the server event "onselectedindexchanged" does not fired when I click a row. Thanks.
<telerik:RadGrid ID="tblSpDetl" runat="server" AutoGenerateColumns="False" GridLines="None"
Skin="WebBlue" Width="100%" AllowPaging="True" AllowSorting="True"
BorderColor="#6699FF" BorderStyle="None" BorderWidth="1px" onselectedindexchanged="tblSpDetl_SelectedIndexChanged" >
<SelectedItemStyle BackColor="#99CCFF" />
<ClientSettings>
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowClick="Row_Single_Click" />
<Scrolling AllowScroll="True" ScrollHeight="100px" SaveScrollPosition="False"></Scrolling>
</ClientSettings>
<MasterTableView CommandItemDisplay="None" CurrentResetPageIndexAction="SetPageIndexToFirst"
Dir="LTR" Frame="Border" TableLayout="Auto" Width="98%"
ClientDataKeyNames="CUST_NAME, CUST_TYPE, FLAT, FLOOR, POS, BLK, CUST_TYPE, MAJOR_INST, PHONE_NO, SN, REMARK"
AllowPaging="False"
onselectedindexchanged="tblSpDetl_SelectedIndexChanged" >
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Name" UniqueName="CUST_NAME"
DataField="CUST_NAME">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Special Customer Type"
UniqueName="CUST_TYPE" DataField="CUST_TYPE">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Flat"
UniqueName="FLAT" DataField="FLAT" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Floor"
UniqueName="FLO0R" DataField="FLOOR" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Pos"
UniqueName="POS" DataField="POS" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Blk"
UniqueName="BLK" DataField="BLK" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Cust. Type"
UniqueName="CUST_TYPE" DataField="CUST_TYPE" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Major Inst"
UniqueName="MAJOR_INST" DataField="MAJOR_INST" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Phone No."
UniqueName="PHONE_NO" DataField="PHONE_NO" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="SN"
UniqueName="SN" DataField="SN" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
ForceExtractValue="None" HeaderText="Remark"
UniqueName="REMARK" DataField="REMARK" Visible="false">
</telerik:GridBoundColumn>
</Columns>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
<HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" ForeColor="Black" Wrap="True" />
<FooterStyle HorizontalAlign ="Left" />
</MasterTableView>
<FilterMenu EnableTheming="True" Skin="WebBlue">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>

Dim stockList As List(Of Pair) = CType(Session("StockList"), List(Of Pair))
stockList.Insert(0,
New Pair(stockCode, stockType))
dgStock.DataSource = stockList
dgStock.DataBind()
I have checked that the stock list definitely has some items in it at this point. In the item data bound event however it is saying the data item is not set to an instance of an object. Here is the code
Protected Sub dgStock_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles dgStock.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Throw New Exception(e.Item.DataItem Is Nothing) <====says TRUE
