<%@
Control Language="C#" AutoEventWireup="true"
CodeBehind="FullFaceMining.ascx.cs"
Inherits="DataEntry.UserControls.FullFaceMining" %>
<script type="text/javascript">
function radTreeView1_Test(sender, eventArgs) {
debugger
}
</script>
<telerik:RadTreeView ID="radTreeView1" runat="server" OnClientDoubleClick="radTreeView1_Test">
</telerik:RadTreeView>
Note that it doesn't actually "do" anything but it has the same pattern of a client-side event referring to a client-side event handler. Lo and behold, it also fails when it's loaded. So at least there's some consistency!
But please believe me ... this was all working fine for the past 6 months!!! Suddenly and inexplicably, my project is seemingly unable to reference a user control's Javascript code now. Clearly I've changed something that has effected this problem but what?!?
Robert W.<%@ Page Language="VB" AutoEventWireup="false" CodeFile="edit_new3.aspx.vb" Inherits="edit" %> <%@ Register Src="Controls/RecordEditForm.ascx" TagName="RecordEditForm" TagPrefix="uc1" %> <!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 runat="server"> <title></title> </head> <body class="RecordEditForm"> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="TableComboBox"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="TableGrid" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="TableGrid"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="TableGrid" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <div> <telerik:RadComboBox ID="TableComboBox" runat="server" Skin="Office2007" AutoPostBack="True"> <Items> <telerik:RadComboBoxItem runat="server" Enabled="False" Font-Italic="True" Selected="True" Text="Choose table" Value="Choose table ..." /> <telerik:RadComboBoxItem runat="server" Text="Employees" Value="Employees" /> <telerik:RadComboBoxItem runat="server" Text="Companies" Value="Companies" /> </Items> </telerik:RadComboBox> </div> <telerik:RadGrid ID="TableGrid" runat="server" AllowSorting="True" Skin="Office2007" AllowFilteringByColumn="True" AutoGenerateColumns="False"> <ClientSettings EnableRowHoverStyle="True" EnableAlternatingItems="False" /> </telerik:RadGrid> </form> </body> </html>Partial Class edit Inherits System.Web.UI.Page Protected Sub TableGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles TableGrid.ItemCommand Select Case e.CommandName Case "Updated" 'How to update my datatable in session End Select End Sub Protected Sub TableGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles TableGrid.NeedDataSourc If TableComboBox.SelectedIndex > 0 Then 'Clear columns TableGrid.Columns.Clear() 'Declares Dim TempTable As New Data.DataTable 'Build fixed columns for delete and edit row Dim EditColumn As New Telerik.Web.UI.GridEditCommandColumn TableGrid.MasterTableView.Columns.Add(EditColumn) EditColumn.ButtonType = Telerik.Web.UI.GridButtonColumnType.ImageButton Dim DeleteColumn As New Telerik.Web.UI.GridClientDeleteColumn TableGrid.MasterTableView.Columns.Add(DeleteColumn) DeleteColumn.ButtonType = Telerik.Web.UI.GridButtonColumnType.ImageButton DeleteColumn.ConfirmText = "Are you sure you want to delete the row?" 'Get Table .... create if it doesn-t exist If Session(TableComboBox.SelectedValue) Is Nothing Then CreateDataSource() TempTable = Session(TableComboBox.SelectedValue) 'Loop through Fields and create Columns and SQL field select For Each Column As Data.DataColumn In TempTable.Columns Dim BoundColumn As New Telerik.Web.UI.GridBoundColumn TableGrid.MasterTableView.Columns.Add(BoundColumn) BoundColumn.DataField = Column.ColumnName BoundColumn.HeaderText = Column.ColumnName Next 'Set datasource TableGrid.DataSource = TempTable End If End Sub Protected Sub TableComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles TableComboBox.SelectedIndexChanged TableGrid.Rebind() End Sub Sub CreateDataSource() 'Create Table Dim EmployeeTable = New Data.DataTable With EmployeeTable .TableName = "Employees" .Columns.Add("ID") .Columns.Add("Name") .Columns.Add("Phone") .Rows.Add({1, "John", "444-667788"}) .Rows.Add({2, "Patric", "555-556677"}) End With Session("Employees") = EmployeeTable Dim CompanyTable As New Data.DataTable With CompanyTable .TableName = "Companies" .Columns.Add("ID") .Columns.Add("Company") .Columns.Add("Phone") .Rows.Add({1, "Microsoft", "444-667788"}) .Rows.Add({2, "Google", "555-556677"}) End With Session("Companies") = CompanyTable End Sub End Class<asp:Label ID="labelStatus" runat="server" /> <br /> <PBM:PBMActionButton ID="linkEdit" runat="server" ImageUrl="~/Images/32/save.png" Text="Update User List" OnClick="linkEdit_OnClick" CssClass="actionbutton" /> <PBM:PBMActionButton ID="linkCancel" runat="server" ImageUrl="~/Images/32/undo.png" Text="Cancel" OnClick="linkCancel_OnClick" CssClass="actionbutton" CausesValidation="false" /> <br /> <br /> <div> <telerik:RadListBox ID="listSource" runat="server" TransferToID="listDestination" AllowTransfer="true" AllowTransferDuplicates="false" AllowTransferOnDoubleClick="false" AutoPostBackOnTransfer="true" SelectionMode="Multiple" TransferMode="Move" Height="200px" Width="225px"> </telerik:RadListBox> <telerik:RadListBox ID="listDestination" runat="server" Height="200px" Width="200px" OnDeleted="listDestination_OnDeleted" OnInserted="listDestination_OnInserted" SelectionMode="Multiple"> </telerik:RadListBox> </div> Hold down the <control> key to select multiple entries at a time.<body> <form style="height: 100%; width: 100%; margin: 0px; padding: 0px;" id="masterForm" runat="server"> <asp:ScriptManager ID="scriptmanagerGlobal" runat="server" EnablePartialRendering="true" EnablePageMethods="true" EnableViewState="true" /> <telerik:RadAjaxManager ID="radajaxmanagerGlobal" runat="server" EnableAJAX="true" EnableViewState="true"> </telerik:RadAjaxManager> <div style="height: 100%; width: 100%"> <div class="headerpane headerbackground"> <telerik:RadSplitter ID="RadSplitter3" runat="server" Orientation="Vertical" Width="100%" Height="45" BorderSize="0" PanesBorderSize="0"> <telerik:RadPane ID="RadPane5" runat="server" Width="50%" Height="49"> <asp:ContentPlaceHolder ID="contentTopLeft" runat="server"> </asp:ContentPlaceHolder> </telerik:RadPane> <telerik:RadPane ID="RadPane6" runat="server" Width="50%" Height="49" CssClass="valigncentered halignright" MinHeight="49" MinWidth="50"> <span style="vertical-align: middle; text-align: right">Logged in as <asp:LoginName ID="LoginName" runat="server" /> </span> </telerik:RadPane> </telerik:RadSplitter> </div> <telerik:RadSplitter ID="RadSplitter1" runat="server" Skin="Windows7" Width="100%" Height="100%" HeightOffset="50" BorderWidth="0px" BorderSize="0"> <telerik:RadPane ID="RadPane2" runat="server" Width="210px" CssClass="leftpane"> <telerik:RadSplitter ID="RadSplitter2" runat="server" Orientation="Horizontal" Width="100%" Height="100%" BorderSize="0" PanesBorderSize="0"> <telerik:RadPane ID="RadPane3" runat="server" Height="80%"> <asp:ContentPlaceHolder ID="contentPaneLeft" runat="server"> Default Content </asp:ContentPlaceHolder> </telerik:RadPane> <telerik:RadPane ID="RadPane4" runat="server" Height="20%"> <asp:ContentPlaceHolder ID="contentPaneLeftBottom" runat="server"> Default Content </asp:ContentPlaceHolder> </telerik:RadPane> </telerik:RadSplitter> </telerik:RadPane> <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" EnableResize="False"> </telerik:RadSplitBar> <telerik:RadPane ID="RadPane1" runat="server"> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="false"> <div class="breadcrumb clear"> <div> <asp:Label ID="LabelTitle" runat="server" CssClass="pagetitle" /><asp:Label ID="LabelSubTitle" runat="server" CssClass="pagesubtitle" /> </div> <asp:PlaceHolder ID="BreadCrumb" runat="server" /> </div> <asp:ContentPlaceHolder ID="contentPaneRight" runat="server"> Default Content </asp:ContentPlaceHolder> </telerik:RadAjaxPanel> </telerik:RadPane> </telerik:RadSplitter> </div> </form> </body> </html>| JavaScriptSerializer serializer = new JavaScriptSerializer(); |
| string serializedPositions = serializer.Serialize(e.Positions); |
| string serializedIndices = serializer.Serialize(e.Indices); |
| string serializedLayout = serializer.Serialize(new string[] { serializedPositions, serializedIndices }); |
| // save it to a SQL Server database |
| string layout = /* get the string from the database */; |
| if (!string.IsNullOrEmpty(layout)) |
| { |
| JavaScriptSerializer serializer = new JavaScriptSerializer(); |
| string[] positionsAndIndices = serializer.Deserialize<string[]>(layout); |
| e.Positions = serializer.Deserialize<Dictionary<string, string>>(positionsAndIndices[0]); |
| e.Indices = serializer.Deserialize<Dictionary<string, int>>(positionsAndIndices[1]); |
| } |
ConfirmText
="This group will be deleted from all users that have this group assigned to them. This process CANNOT be undone. Are You Sure Want To Delete This Group?" ConfirmDialogType="RadWindow"
Thank You
<telerik:RadNumericTextBox ID="rntMyTextBox" Type="Number" runat="server"I am able to stack methods on other HTML properties, such as when I add an onChange="alert('A'); alert('B');" property and change the value via the page, then I get the expected message boxes, the first saying A, the second saying B.
MaxValue="997" EnabledStyle-HorizontalAlign="Right" Font-Size="Small" MaxLength="3"
MinValue="0" Width="153px" FocusedStyle-PaddingRight="1px" ShowSpinButtons="true"
ClientEvents-OnValueChanged="MethodA(); MethodB();">
The AddOnChange method loops through all the controls in the passed in control set. For each control, it tries to decide how best to apply an 'onChange' event... ADDING to any existing method defined. The way I'm trying to do this for a RadNumericEtc is something like ://Add the OnChange event to all the appropriate controls on this user control. ControlManager.AddOnChange(this.Controls, "SetDirtyFlag", true);
else if(control is RadNumericTextBox)This way, when I call AddOnChange, the SetDirtyFlag method call would be ADDED to any other method(s) defined to fire when the value changes. The SetDirtyFlag simply sets the 'FormHasChanged' flag to true, without needing to include any other specific logic.
{
(control as RadNumericTextBox).ClientEvents.OnValueChanged = (control as RadNumericTextBox).ClientEvents.OnValueChanged + ";" + onChangeString;
//We also want to avoid user tab to the up and down spinner buttons on any RadNumericTextBox controls.
(control as RadNumericTextBox).ButtonDownContainer.Attributes.Add("tabindex", "-1");
(control as RadNumericTextBox).ButtonUpContainer.Attributes.Add("tabindex", "-1");
}
