This is a migrated thread and some comments may be shown as answers.

Enter key same as rad filter Apply Button

9 Answers 113 Views
Filter
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 04 May 2012, 08:41 PM
is there a way i can attach the Enter Key event to
fire or invoke a click event for the rad filter on a page???
i understand the small code below is in the code behind - just for clarification -  & i would need to do this from javascript.
any help is appreciated.
thx
rik


 

 

protected void SearchExitedTrucksRadFilter_Apply(object sender, EventArgs e)

 

9 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 09 May 2012, 02:44 PM
Hi Rik,

Can you specify where you want to attach the keypress event? If it is on each input in the field editors, try the following implementation:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<script type="text/javascript">
    function applyExpression(sender, args) {
        if (args.get_keyCode() == 13) {
            setTimeout(function () {
                $find('<%=RadFilter1.ClientID %>').applyExpressions();
            }, 10);
        }
    }
</script>
<telerik:RadFilter ID="RadFilter1" runat="server" OnPreRender="RadFilter1_PreRender">
    <FieldEditors>
        <telerik:RadFilterDateFieldEditor FieldName="Field1" />
        <telerik:RadFilterNumericFieldEditor FieldName="Field2" />
        <telerik:RadFilterTextFieldEditor FieldName="Field3" />
    </FieldEditors>
</telerik:RadFilter>


protected void RadFilter1_PreRender(object sender, EventArgs e)
{
    var inputs = ControlsOfType<RadInputControl>(RadFilter1);
    if (inputs.FirstOrDefault() != null)
    {
        foreach (RadInputControl input in inputs)
        {
            input.ClientEvents.OnKeyPress = "applyExpression";
        }
    }
}
 
public IEnumerable<T> ControlsOfType<T>(Control parent) where T : class
{
    foreach (Control control in parent.Controls)
    {
        if (control is T)
        {
            yield return control as T;
            continue;
        }
 
        foreach (T descendant in ControlsOfType<T>(control))
        {
            yield return descendant;
        }
    }
}

I hope this helps.

Regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
rik butcher
Top achievements
Rank 1
answered on 09 May 2012, 03:03 PM
i can't reference any  Telerik Control using <%
i've pasted the entire .aspx page  -  it looks like somehow the enter key is hooked up with (<asp:ImageButton ID="DeleteItem) on the bottom RadGrid and it really shouldn't be, it should require a click.
thanks again
rik

<%

 

@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReceivingTruck.aspx.cs"

 

 

 

Inherits="NOV.GOLD.WebApp.Trucking.ReceivingTruck" Theme="GOLD Popup" %>

 

<!

 

 

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">

 

 

 

<base target="_self" />

 

 

 

<title>NOV GOLD - Receiving Truck</title>

 

</

 

 

head>

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<telerik:RadFormDecorator ID="ButtonFormDecorator" runat="server" Skin="WebBlue"

 

 

 

DecoratedControls="Buttons" />

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

 

<Scripts>

 

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />

 

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />

 

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />

 

 

 

</Scripts>

 

 

 

</telerik:RadScriptManager>

 

 

 

<script type="text/javascript" src="../Scripts/CommonFunctions.js"></script>

 

 

 

<script type="text/javascript" src="../Scripts/Trucking.js"></script>

 

 

 

<a id="RedirectLink" href="" class="hideObject"></a>

 

 

 

<telerik:RadAjaxPanel ID="MainContentAjaxPanel" runat="server" LoadingPanelID="ToolBarAjaxLoadingPanel">

 

 

 

<div id="header">

 

 

 

<asp:Label ID="HeaderTitleLabel" runat="server" CssClass="popupTitleLabel" />

 

 

 

<div id="headerRight">

 

 

 

<asp:Label ID="TitleLable" runat="server"/>

 

 

 

</div>

 

 

 

</div>

 

 

 

<div id="mainContent">

 

 

 

<div class="toolbar">

 

 

 

<table>

 

 

 

<tr>

 

 

 

<td>

 

 

 

<telerik:RadToolBar ID="TruckLogToolBar" runat="server" Orientation="Horizontal"

 

 

 

Skin="Default" OnButtonClick="TruckLogToolBar_ButtonClick">

 

 

 

<Items>

 

 

 

<telerik:RadToolBarButton runat="server" Text="Exit" ImagePosition="Left" NavigateUrl="javascript:window.close()"

 

 

 

ImageUrl="~/App_Themes/GOLD Main/ToolBar/delete_16x16.gif" ToolTip="Close Truck Log" />

 

 

 

<telerik:RadToolBarButton runat="server" IsSeparator="true" />

 

 

 

<telerik:RadToolBarButton runat="server" Text="Record Selected" ImagePosition="Left"

 

 

 

NavigateUrl="" ImageUrl="~/App_Themes/GOLD Main/ToolBar/move_16x16.gif" ToolTip="Log In Selected Items" />

 

 

 

<telerik:RadToolBarButton runat="server" Text="Work Order" ImagePosition="Left" NavigateUrl="javascript:OpenNewWorkOrder()"

 

 

 

ImageUrl="~/App_Themes/GOLD Main/ToolBar/record_add_16x16.gif" ToolTip="Create New Work Order" />

 

 

 

<telerik:RadToolBarButton runat="server" Text="Storage" ImagePosition="Left" ImageUrl="~/App_Themes/GOLD Main/ToolBar/record_add_16x16.gif"

 

 

 

ToolTip="Create New Storage Order" NavigateUrl="javascript:OpenNewStorageWorkOrder()" />

 

 

 

<telerik:RadToolBarButton runat="server" IsSeparator="true" />

 

 

 

<telerik:RadToolBarButton runat="server" Text="Authorize" ImagePosition="Left" NavigateUrl=""

 

 

 

ImageUrl="~/App_Themes/GOLD Main/ToolBar/print_16x16.gif" ToolTip="Print Unloading Authorization" />

 

 

 

<telerik:RadToolBarButton runat="server" IsSeparator="true" />

 

 

 

<telerik:RadToolBarButton runat="server" Text="Exit Truck" ImagePosition="Left" NavigateUrl=""

 

 

 

ImageUrl="~/App_Themes/GOLD Main/ToolBar/checkmark_16x16.gif" ToolTip="Exit Truck" />

 

 

 

</Items>

 

 

 

</telerik:RadToolBar>

 

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadAjaxLoadingPanel ID="ToolBarAjaxLoadingPanel" runat="server" IsSticky="true"

 

 

 

CssClass="ajaxLoadingPanel">

 

 

 

<asp:Image ID="AjaxLoadingImage" runat="server" ImageUrl="~/App_Themes/GOLD Main/Images/ajax_loader_blue.gif"

 

 

 

CssClass="ajaxLoadingImage" />

 

 

 

<asp:Label ID="AjaxLoadingLabel" runat="server" CssClass="ajaxLoadingLabel" Text="Loading..." />

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</div>

 

 

 

<telerik:RadTabStrip runat="server" ID="TruckLogTabStrip" SelectedIndex="0" Skin="Default"

 

 

 

MultiPageID="TruckLogMultiPage" Width="100%" CssClass="tabStrip" AutoPostBack="true">

 

 

 

<Tabs>

 

 

 

<telerik:RadTab runat="server" Text="Truck Info" PageViewID="TruckInfoPageView" />

 

 

 

<telerik:RadTab runat="server" Text="Log Items" PageViewID="LogItemsPageView" />

 

 

 

</Tabs>

 

 

 

</telerik:RadTabStrip>

 

 

 

<telerik:RadMultiPage runat="server" ID="TruckLogMultiPage" SelectedIndex="0" CssClass="multiPageView"

 

 

 

RenderSelectedPageOnly="true">

 

 

 

<telerik:RadPageView runat="server" ID="TruckInfoPageView">

 

 

 

<table class="detailsTable" id="TruckLogHeaderInfoTable" runat="server">

 

 

 

<tr>

 

 

 

<td class="disabledDesc">

 

Truck Type

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadComboBox ID="TruckTypeComboBox" runat="server" Width="120px" Skin="WebBlue"

 

 

 

Enabled="false">

 

 

 

<Items>

 

 

 

<telerik:RadComboBoxItem Value="0" Text="Shipping" />

 

 

 

<telerik:RadComboBoxItem Value="-1" Text="Receiving" />

 

 

 

</Items>

 

 

 

</telerik:RadComboBox>

 

 

 

</td>

 

 

 

<td class="disabledDesc">

 

Date In

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="DateInTextBox" runat="server" Width="150px" Skin="WebBlue"

 

 

 

CssClass="textbox" ReadOnly="true" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td class="disabledDesc">

 

Status

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadComboBox ID="StatusComboBox" runat="server" Width="100px" Skin="WebBlue"

 

 

 

Enabled="false">

 

 

 

<Items>

 

 

 

<telerik:RadComboBoxItem Text="In Yard" />

 

 

 

</Items>

 

 

 

</telerik:RadComboBox>

 

 

 

</td>

 

 

 

<td class="disabledDesc">

 

Division

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="DivisionTextBox" runat="server" Width="200px" Skin="WebBlue"

 

 

 

CssClass="textbox" ReadOnly="true" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

<div class="detailsHeader">

 

Truck Information

 

 

</div>

 

 

 

<table class="detailsTable">

 

 

 

<tr>

 

 

 

<td class="requiredDesc">

 

Carrier

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadComboBox ID="CarrierComboBox" runat="server" Width="200px" Skin="WebBlue"

 

 

 

EmptyMessage="- Select -" EnableLoadOnDemand="true" OnItemsRequested="CarrierComboBox_ItemsRequested"

 

 

 

AllowCustomText="false" DataTextField="TRUCKCARRIER" DataValueField="TRUCKCARRIERID"

 

 

 

Height="120px" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td class="requiredDesc">

 

Truck #

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="TruckNumberTextBox" runat="server" Width="200px" Skin="WebBlue"

 

 

 

CssClass="textbox" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td class="requiredDesc">

 

Driver

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="TruckDriverTextBox" runat="server" Width="200px" Skin="WebBlue"

 

 

 

CssClass="textbox" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td class="requiredDesc">

 

Witness

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadComboBox ID="WitnessComboBox" runat="server" Width="200px" Skin="WebBlue"

 

 

 

EmptyMessage="- Select -" EnableLoadOnDemand="true" OnItemsRequested="WitnessComboBox_ItemsRequested"

 

 

 

AllowCustomText="false" DataTextField="WITNESSNAME" DataValueField="WITNESSID"

 

 

 

Height="120px" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td class="inputDesc">

 

Trucking

 

<br />

 

Comments

 

 

</td>

 

 

 

<td>

 

 

 

<telerik:RadTextBox ID="TruckingCommentsTextBox" runat="server" Width="400px" Skin="WebBlue"

 

 

 

CssClass="textbox" TextMode="MultiLine" Rows="5" />

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

<br />

 

 

 

<div id="OKCancelButtons">

 

 

 

<asp:Button ID="OKButton" runat="server" Text="OK" CssClass="button" OnClick="OKButton_Click" />

 

 

 

&nbsp;&nbsp;

 

 

 

<asp:Button ID="CancelButton" runat="server" Text="Cancel" CssClass="button" OnClientClick="window.close();" />

 

 

 

</div>

 

 

 

</telerik:RadPageView>

 

 

 

<telerik:RadPageView runat="server" ID="LogItemsPageView">

 

 

 

<!-- FILTER FOR THE DEFECT -->

 

 

 

<div style="margin: 0 0 14px 0;width:850px";>

 

 

 

<table>

 

 

 

 

<tr>

 

 

 

<td>

 

 

 

<telerik:RadFilter ID="ReceivingTrucksRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

 

 

 

OnApplyExpressions="ReceivingTrucksRadFilter_Apply" OnFieldEditorCreating="RadFilter_FieldEditorCreating" ApplyButtonText="Filter WorkOrders">

 

<%

 

--OnPreRender="WorkOrdersRadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating"--%>

 

 

 

<FieldEditors>

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="Work Order#"

 

 

 

DataType="System.String" />

 

 

 

<goldcustom:RadFilterComboBoxEditor FieldName="WOTYPENAME" DisplayName="WO Type"

 

 

 

DataTextField="WOTYPENAME" DataSourceID="WorkOrderTypeFilterODS" DataType="System.String"

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="TRACKINGNUMBER" DisplayName="Tracking#"

 

 

 

DataType="System.String" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="KEYREFERENCE" DisplayName="Key Ref"

 

 

 

DataType="System.String" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="SIZEVALUE" DisplayName="Size"

 

 

 

DataType="System.String" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WEIGHTPERLENGTH" DisplayName="Weight Per Len"

 

 

 

DataType="System.String" />

 

 

 

<goldcustom:RadFilterComboBoxEditor FieldName="STATUS_MESSAGE" DisplayName="Status"

 

 

 

DataSourceID="WorkOrderItemStatusFilterODS" DataType="System.String" ComboBoxSkin="WebBlue" />

 

 

 

<goldcustom:RadFilterComboBoxEditor FieldName="MATERIALTYPE" DisplayName="Material Type"

 

 

 

DataSourceID="MaterialTypeFilterODS" DataType="System.String" ComboBoxWidth="90px"

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="SUPPLIER_COMPANYNAME" DisplayName="Supplier"

 

 

 

DataType="System.String" />

 

 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 

 

 

</td> </tr> </table>

 

 

 

</div>

 

 

 

<div><table><tr><td> <asp:Label ID="ErrorMessageLabel" runat="server" ForeColor="Red" /></td></tr></table></div>

 

 

 

<telerik:RadGrid ID="WorkOrderItemsRadGrid" runat="server" AllowPaging="true" AutoGenerateColumns="false"

 

 

 

Skin="WebBlue" PageSize="8" EnableTheming="false" AllowFilteringByColumn="false" AllowCustomPaging="false"

 

 

 

OnItemDataBound="WorkOrderItemsRadGrid_ItemDataBound" OnNeedDataSource="WorkOrderItemsRadGrid_NeedDataSource"

 

 

 

Width="100%" OnItemCreated="WorkOrderItemsRadGrid_ItemCreated" AllowMultiRowSelection="true">

 

 

 

<GroupingSettings CaseSensitive="false" />

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

 

<MasterTableView DataKeyNames="WORKORDERNUMBER,LOCATIONID,WORKORDERID,WORKORDERDETAILID,LASTUPDATED,LASTUPDATEDBY,MATERIALTYPE,MATERIALTYPEID,MATERIALDESCRIPTION"

 

 

 

CommandItemSettings-ShowAddNewRecordButton="false" EditMode="PopUp" CommandItemDisplay="Top"

 

 

 

AllowSorting="true" CommandItemSettings-RefreshText="Refresh" CommandItemSettings-RefreshImageUrl="~/App_Themes/GOLD Main/ToolBar/refresh_16x16.gif" >

 

 

 

<HeaderStyle HorizontalAlign="Left" />

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="60px" UniqueName="OptionsMenuCell"

 

 

 

ItemStyle-HorizontalAlign="Left" ItemStyle-Width="60px" ItemStyle-Wrap="false"

 

 

 

ItemStyle-VerticalAlign="Middle">

 

 

 

<ItemTemplate>

 

 

 

<asp:Image ID="RecordInfoImage" runat="server" ImageUrl="~/App_Themes/GOLD Main/Images/grid_info.gif"

 

 

 

CssClass="gridviewOptionsImage" />

 

 

 

<telerik:RadToolTip ID="InfoRadToolTip" runat="server" TargetControlID="RecordInfoImage"

 

 

 

Skin="Sunset" Position="MiddleRight" CssClass="gridviewToolTip" />

 

 

 

<asp:Image ID="PopupMenuImage" runat="server" ImageUrl="~/App_Themes/GOLD Main/Images/grid_menu_popup.gif"

 

 

 

CssClass="gridviewOptionsImage" />

 

 

 

<telerik:RadContextMenu ID="OptionsRadContextMenu" runat="server" Skin="WebBlue"

 

 

 

CssClass="leftText">

 

 

 

<Targets>

 

 

 

<telerik:ContextMenuControlTarget ControlID="PopupMenuImage" />

 

 

 

</Targets>

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem Text="View/Edit Work Order Item" ImageUrl="../App_Themes/GOLD Main/ToolBar/preview_16x16.gif" />

 

 

 

</Items>

 

 

 

</telerik:RadContextMenu>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="20px" UniqueName="SelectionCheckBoxCell"

 

 

 

ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20px" ItemStyle-Wrap="false"

 

 

 

ItemStyle-VerticalAlign="Middle">

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox ID="RowSelectionCheckBox" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBoxRowSelection" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="40px" UniqueName="QtyInColumn"

 

 

 

ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px" HeaderText="Qty In">

 

 

 

<ItemTemplate>

 

 

 

<telerik:RadTextBox ID="QuantityInGridTextBox" runat="server" Width="30px" CssClass="textbox"

 

 

 

Skin="WebBlue" AutoPostBack="true" OnTextChanged="TextBoxRowSelection" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="100px" UniqueName="RackNumberColumn"

 

 

 

ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Rack">

 

 

 

<ItemTemplate>

 

 

 

<telerik:RadComboBox ID="RackNumberGridComboBox" runat="server" Width="90px" Height="160px"

 

 

 

Skin="WebBlue" EnableLoadOnDemand="true" OnItemsRequested="RackNumberGridComboBox_ItemsRequested"

 

 

 

AllowCustomText="false" HighlightTemplatedItems="true" DataValueField="RACKID"

 

 

 

DataTextField="RACKNUMBER" DropDownWidth="210px">

 

 

 

<HeaderTemplate>

 

 

 

<ul class="woCustomerDropDown" style="width: 180px;">

 

 

 

<li class="woCustomerCol" style="width: 120px;">Rack Number</li>

 

 

 

<li class="woCustomerCol" style="width: 60px;">Utilization</li>

 

 

 

</ul>

 

 

 

</HeaderTemplate>

 

 

 

<ItemTemplate>

 

 

 

<ul class="woCustomerDropDown" style="width: 180px;">

 

 

 

<li class="woCustomerCol" style="width: 120px;">

 

<%

 

# DataBinder.Eval(Container.DataItem, "RACKNUMBER") %></li>

 

 

 

<li class="woCustomerCol" style="width: 60px;">

 

<%

 

# DataBinder.Eval(Container.DataItem, "UTILIZATION") %></li>

 

 

 

</ul>

 

 

 

</ItemTemplate>

 

 

 

</telerik:RadComboBox>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="WORKORDERITEMDISPLAY" HeaderText="Work Order"

 

 

 

HeaderStyle-Width="80px" FilterControlWidth="60px" />

 

 

 

<goldcustom:ComboBoxFilteringColumn DataField="WOTYPENAME" HeaderText="Type" ReadOnly="true"

 

 

 

ComboBoxFilterDataSourceID="WorkOrderTypeFilterODS" ComboBoxFilterSkin="WebBlue"

 

 

 

ComboBoxFilterWidth="90px" />

 

 

 

<telerik:GridBoundColumn DataField="QTY" HeaderText="Qty" AllowFiltering="false" />

 

 

 

<telerik:GridBoundColumn DataField="OPENCOUNT" HeaderText="O" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="ACTIVECOUNT" HeaderText="A" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="INPROCESSCOUNT" HeaderText="I" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="COMPLETEDCOUNT" HeaderText="C" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<goldcustom:ComboBoxFilteringColumn DataField="MATERIALTYPE" HeaderText="Type" ReadOnly="true"

 

 

 

ComboBoxFilterDataSourceID="MaterialTypeFilterODS" ComboBoxFilterSkin="WebBlue"

 

 

 

ComboBoxFilterWidth="100px" HeaderStyle-Width="100px" />

 

 

 

<telerik:GridBoundColumn DataField="SIZEVALUE" HeaderText="Size" FilterControlWidth="40px" />

 

 

 

<telerik:GridBoundColumn DataField="WEIGHTPERLENGTH" HeaderText="Weight" FilterControlWidth="40px" />

 

 

 

<telerik:GridBoundColumn DataField="SUPPLIER_COMPANYNAME" HeaderText="Supplier" FilterControlWidth="140px" />

 

 

 

<telerik:GridBoundColumn DataField="MATERIALTYPE" Visible="false" />

 

 

 

<telerik:GridBoundColumn DataField="KEYREFERENCE" HeaderText="Ref #" FilterControlWidth="60px" />

 

 

 

<goldcustom:ComboBoxFilteringColumn DataField="STATUS_MESSAGE" HeaderText="Status"

 

 

 

ReadOnly="true" ComboBoxFilterDataSourceID="WorkOrderItemStatusFilterODS" ComboBoxFilterSkin="WebBlue"

 

 

 

ComboBoxFilterWidth="110px" />

 

 

 

<telerik:GridBoundColumn DataField="TRACKINGNUMBER" HeaderText="Tracking #" FilterControlWidth="60px" />

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

<!-- TRUCKS GRID BELOW -->

 

 

 

<asp:Label ID="lblError" ForeColor="Red" Font-Bold="true" runat="server" />

 

 

 

<br />

 

 

 

<asp:Panel ID="Panel1" runat="server" CssClass="detailsHeader" Width="1680px">

 

Truck Log Items

 

 

</asp:Panel>

 

 

 

<telerik:RadGrid ID="TruckLogItemsRadGrid" runat="server" AllowPaging="false" AutoGenerateColumns="false"

 

 

 

Skin="WebBlue" EnableTheming="false" AllowFilteringByColumn="false" OnItemDataBound="TruckLogItemsRadGrid_ItemDataBound"

 

 

 

OnNeedDataSource="TruckLogItemsRadGrid_NeedDataSource" Width="1700px" ShowStatusBar="true"

 

 

 

OnDeleteCommand="TruckLogItemsRadGrid_DeleteCommand">

 

 

 

<GroupingSettings CaseSensitive="false" />

 

 

 

<ClientSettings EnableRowHoverStyle="true" />

 

 

 

<MasterTableView DataKeyNames="TRUCKLOGITEMID,CREATEDDATE,CREATEDBY,LASTUPDATED,LASTUPDATEDBY,MATERIALTYPEID,MATERIALDESCRIPTION">

 

 

 

<HeaderStyle HorizontalAlign="Left" />

 

 

 

<Columns>

 

 

 

<telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="50px" UniqueName="OptionsMenuCell"

 

 

 

ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50px" ItemStyle-Wrap="false">

 

 

 

<ItemTemplate>

 

 

 

<asp:Image ID="RecordInfoImage" runat="server" ImageUrl="~/App_Themes/GOLD Main/Images/grid_info.gif"

 

 

 

CssClass="gridviewOptionsImage" />

 

 

 

<telerik:RadToolTip ID="InfoRadToolTip" runat="server" TargetControlID="RecordInfoImage"

 

 

 

Skin="Sunset" Position="MiddleRight" CssClass="gridviewToolTip" />

 

 

 

<asp:ImageButton ID="DeleteItem" runat="server" ImageUrl="~/App_Themes/GOLD Main/ToolBar/trash_16x16.gif"

 

 

 

CommandName="Delete" CssClass="gridviewOptionsImage" OnClientClick="javascript:if(!confirm('This action will delete the selected truck log item. Are you sure?')){return false;}" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="LOGITEM" HeaderText="#" HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="QTY" HeaderText="Qty" AllowFiltering="false" />

 

 

 

<telerik:GridBoundColumn DataField="LENGTH" HeaderText="Length" HeaderStyle-Width="60px" />

 

 

 

<telerik:GridBoundColumn DataField="RACKNUMBER" HeaderText="Rack #" HeaderStyle-Width="60px" />

 

 

 

<telerik:GridBoundColumn DataField="TRACKINGNUMBER" HeaderText="Tracking #" FilterControlWidth="60px" />

 

 

 

<telerik:GridBoundColumn DataField="TALLYCOUNT" HeaderText="Tally" HeaderStyle-Width="40px" />

 

 

 

<telerik:GridBoundColumn DataField="WORKORDERITEMDISPLAY" HeaderText="Work Order"

 

 

 

HeaderStyle-Width="80px" FilterControlWidth="60px" />

 

 

 

<telerik:GridBoundColumn DataField="WOTYPENAME" HeaderText="Type" ReadOnly="true" />

 

 

 

<telerik:GridBoundColumn DataField="WOQTY" HeaderText="WO Qty" AllowFiltering="false" />

 

 

 

<telerik:GridBoundColumn DataField="OPENCOUNT" HeaderText="O" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="ACTIVECOUNT" HeaderText="A" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="INPROCESSCOUNT" HeaderText="I" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="COMPLETEDCOUNT" HeaderText="C" AllowFiltering="false"

 

 

 

HeaderStyle-Width="30px" />

 

 

 

<telerik:GridBoundColumn DataField="MATERIALTYPE" HeaderText="Type" ReadOnly="true"

 

 

 

HeaderStyle-Width="100px" />

 

 

 

<telerik:GridBoundColumn DataField="SIZEVALUE" HeaderText="Size" FilterControlWidth="40px" />

 

 

 

<telerik:GridBoundColumn DataField="WEIGHTPERLENGTH" HeaderText="Weight" FilterControlWidth="40px" />

 

 

 

<telerik:GridBoundColumn DataField="OWNER_COMPANYNAME" HeaderText="Owner" FilterControlWidth="140px" />

 

 

 

<telerik:GridBoundColumn DataField="KEYREFERENCE" HeaderText="Ref #" FilterControlWidth="60px" />

 

 

 

<telerik:GridBoundColumn DataField="MESSAGE" HeaderText="Status" ReadOnly="true" />

 

 

 

<telerik:GridBoundColumn DataField="MATERIALCOLORBAND" HeaderText="Color" ReadOnly="true" />

 

 

 

<telerik:GridBoundColumn DataField="SERVICECODE" HeaderText="SvcCd" ReadOnly="true" />

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

</telerik:RadPageView>

 

 

 

</telerik:RadMultiPage>

 

 

 

</div>

 

 

 

</telerik:RadAjaxPanel>

 

 

 

<!-- ****** START Column Filter ObjectDataSources ****** -->

 

 

 

<asp:ObjectDataSource ID="WorkOrderTypeFilterODS" runat="server" SelectMethod="GetWorkOrderTypes"

 

 

 

TypeName="NOV.GOLD.Business.WorkOrdersBC" />

 

 

 

<asp:ObjectDataSource ID="MaterialTypeFilterODS" runat="server" SelectMethod="GetMaterialTypes"

 

 

 

TypeName="NOV.GOLD.Business.WorkOrdersBC" />

 

 

 

<asp:ObjectDataSource ID="WorkOrderItemStatusFilterODS" runat="server" SelectMethod="GetWorkOrderItemStatusMessages"

 

 

 

TypeName="NOV.GOLD.Business.WorkOrdersBC" />

 

 

 

<!-- ****** END Column Filter ObjectDataSources ****** -->

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>

 


0
rik butcher
Top achievements
Rank 1
answered on 09 May 2012, 05:03 PM
Tsvetina - i think i could solve this if i could use PageMethods.
but i keep getting : PageMethods,Microsoft JScript runtime error: Object doesn't support this property or method
and using this code.
any ideas why - this is creating the error?

 

 

<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">

 

 

 

<Scripts>

 

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />

 

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />

 

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />

 

 

 

</Scripts>

 

 

 

</asp:ScriptManager>

 

 

 

<script type="text/javascript" src="../Scripts/CommonFunctions.js"></script>

 

 

 

<script type="text/javascript" src="../Scripts/Trucking.js"></script>

 

 

 

<script type="text/javascript" >

 

 

 

function DeleteTruckLog(TruckLogItemid) {

 

 

 

var myUser = document.getElementById("txtCurrentUser").value;

 

PageMethods.DeleteTruckLogItem(TruckLogItemid,myUser);

__doPostBack(

 

'__Page', ''); //DO POST BACK SO THE PAGE LOAD EVENT WILL PICK THIS UP AND REBIND THE GRID

 

alert(

 

"You may need to do a manual refresh to see your Grid changes");

 

 

}

 

 

</script>

 

0
Tsvetina
Telerik team
answered on 14 May 2012, 11:54 AM
Hello Rik,

Have you tried the suggestion from the support ticket that you have opened on the same problem?

If you are pasting the script directly into the page, wrap the script tag in a RadCodeBlock or RadScriptBlock.

Also, it seems like the RadFilter is not inside a naming container, so you should be able to hard-code its ID in the $find method, e.g. $find('ReceivingTrucksRadFilter').

If this does not help, in order to avoid duplicate posts, please write to us using the formal support thread started.

All the best,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
rik butcher
Top achievements
Rank 1
answered on 14 May 2012, 12:04 PM
Tsvetina, sorry about the duplicate post. i was able to get this to work, but not using the code sent. i used an asp.button & attached "enter key" event to that & trigger the "FireApplyCommand()" which - i know is a hack but works just fine.
thanks again so much for all of your help.... and patience w/ me
rik
0
Konda
Top achievements
Rank 1
answered on 31 Oct 2013, 09:46 AM


protected void RadFilter1_PreRender(object sender, EventArgs e)
{
    var inputs = ControlsOfType<RadInputControl>(RadFilter1);
    if (inputs.FirstOrDefault() != null)
    {
        foreach (RadInputControl input in inputs)
        {
            input.ClientEvents.OnKeyPress = "applyExpression";
        }
    }
}
 
public IEnumerable<T> ControlsOfType<T>(Control parent) where T : class
{
    foreach (Control control in parent.Controls)
    {
        if (control is T)
        {
            yield return control as T;
            continue;
        }
 
        foreach (T descendant in ControlsOfType<T>(control))
        {
            yield return descendant;
        }
    }
}


<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<script type="text/javascript">
    function applyExpression(sender, args) {
        if (args.get_keyCode() == 13) {
            setTimeout(function () {
                $find('<%=RadFilter1.ClientID %>').applyExpressions();
            }, 10);
        }
    }
</script>
<telerik:RadFilter ID="RadFilter1" runat="server" OnPreRender="RadFilter1_PreRender">
    <FieldEditors>
        <telerik:RadFilterDateFieldEditor FieldName="Field1" />
        <telerik:RadFilterNumericFieldEditor FieldName="Field2" />
        <telerik:RadFilterTextFieldEditor FieldName="Field3" />
    </FieldEditors>
</telerik:RadFilter>



this code only working int and datetime columns working fine but i want varchar columns also,
plz give me reply how to fix this issue



0
Konstantin Dikov
Telerik team
answered on 05 Nov 2013, 09:07 AM
Hi Konda,

The behavior you are describing is due to the fact that RadFilterTextFieldEditor generates TextBox control and not RadInputControl. 

Other issue you will face with this is that the TextBox control does not have "OnKeyPress" client event.

For your scenario you could change your RadFilter1_PreRender event handler with the following:
protected void RadFilter1_PreRender(object sender, EventArgs e)
{
    var inputs = ControlsOfType<RadInputControl>(RadFilter1);
    if (inputs.FirstOrDefault() != null)
    {
        foreach (RadInputControl input in inputs)
        {
            input.Attributes.Add("onkeydown", "applyExpression(event)");
        }
    }
 
    var textBoxControls = ControlsOfType<TextBox>(RadFilter1);
    if (textBoxControls.FirstOrDefault() != null)
    {
        foreach (TextBox input in textBoxControls)
        {
            input.Attributes.Add("onkeydown", "applyExpression(event)");
        }
    }
}
And the JavaScript for "onkeydown" event:
<script type="text/javascript">
    function applyExpression(event) {
        if (event.keyCode == 13) {
            setTimeout(function () {
                debugger;
                $find('<%=RadFilter1.ClientID %>').applyExpressions();
            }, 10);
        }
    }
</script>

Hope that helps.

 

Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Young
Top achievements
Rank 1
answered on 21 Jul 2015, 06:13 PM
With the code posted I'm getting an error "ControlsOfType" does not exist.  Am I missing an include statement?  How can I fix this?
0
Konstantin Dikov
Telerik team
answered on 23 Jul 2015, 10:43 AM
Hello Young,

The ControlsOfType method that you need to include in your page could be found in the first answer in the thread:
public IEnumerable<T> ControlsOfType<T>(Control parent) where T : class
{
    foreach (Control control in parent.Controls)
    {
        if (control is T)
        {
            yield return control as T;
            continue;
        }
  
        foreach (T descendant in ControlsOfType<T>(control))
        {
            yield return descendant;
        }
    }
}

Hope this helps.


Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Filter
Asked by
rik butcher
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
rik butcher
Top achievements
Rank 1
Konda
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Young
Top achievements
Rank 1
Share this question
or