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

RadComboBox inside FilterTemplate

1 Answer 175 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
nick
Top achievements
Rank 1
nick asked on 04 Jan 2016, 04:54 PM

Hi,

I've been trying to create a FilterTemplate with a RadComboBox inside it to filter the contents of a RadGrid on the selectedindexchanged event in a sharepoint webpart. But for some weird reason, the reference material that I've found are not working for me.


Here are the following approaches that I tried.

1. Client-side approach (OnClientSelectedIndexChanged)

http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

Tried the client-side approach but for some weird reason the tableView is null so obviously the event is not firing.

<telerik:GridBoundColumn UniqueName="Source" HeaderText="Source" DataField="CompanyOTHemscottOverride_V1.MacroOTHemscott3Source" AutoPostBackOnFilter="false">
   <FilterTemplate>
       <asp:DropDownList ID="DropDownList1" runat="server">
       </asp:DropDownList>
        <telerik:RadComboBox ID="rcbSource" runat="server" OnClientSelectedIndexChanged="UpdateIndustryFilters" OnSelectedIndexChanged="rgrdIndustry_UpdateFilters"
            AppendDataBoundItems="true" Width="60px">
            <Items>
                <telerik:RadComboBoxItem Text="All" />
            </Items>
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="rsb" runat="server">
            <script type="text/javascript">
                function UpdateIndustryFilters(sender, args) {
                    alert('firing filter event');
                    var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
                    alert(tableView);
                    alert(args.get_item().get_value());
                    tableView.filter("MacroOTHemscott3", args.get_item().get_value(), "EqualTo");
                }
            </script>
        </telerik:RadScriptBlock>
   </FilterTemplate>
</telerik:GridBoundColumn>

 

2. Server-Side - OnSelectedIndexChanged

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/filtering/filter-template

I also tried this but for some weird reason, I am unable to add the event handler on the server side (.vb) code as  I am being bumped with the error "Handles clause requires a WithEvents variable defined in the containing type or one of its base types."

 

Protected Sub rgrdIndustry_UpdateFilters(sender As Object, e As RadComboBoxSelectedIndexChangedEventArgs) Handles rcbSource.SelectedIndexChanged
    Me._presenter.IndustryAssignment_Update(sender, e)
End Sub

 

3. Adding the event programmatically.

Protected Sub rgrdIndustryAssignment_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgrdIndustryAssignment.ItemCreated
    If (TypeOf e.Item Is GridFilteringItem) Then
        Dim item As GridFilteringItem = DirectCast(e.Item, GridFilteringItem)
        Dim combo As RadComboBox = DirectCast(e.Item.FindControl("rcbSource"), RadComboBox)
        combo.AutoPostBack = True
        AddHandler combo.OnSelectedIndexChanged, AddressOf rgrdIndustry_UpdateFilters
    End If
End Sub

Tried this approach as well but this time I am getting the error,  "'Telerik,Web.UI.RadComboBox.Protected Overridable Sub OnSelectedIndexChanged()' is not accessible in this context because it is 'Protected'"

 Right now I am really lost and if you could please help out with making at least option #2 work, it would be much appreciated as this is the approach that I am aiming for, but right now I'll accept anything that works :)

Full markup can be seen below.

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="VB" AutoEventWireup="true" CodeBehind="IndustryAssignmentWPUserControl.ascx.vb"
    Inherits="Industry.IndustryAssignmentWPUserControl" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2013.2.717.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://www.jsviews.com/download/jsrender.min.js"></script>
<telerik:RadAjaxManagerProxy ID="ajaxManagerProxy" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgrdIndustryAssignment">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgrdIndustryAssignment" LoadingPanelID="loadingPanel" />
                <telerik:AjaxUpdatedControl ControlID="divError" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel ID="loadingPanel" runat="server" Skin="Default" />
<telerik:RadFormDecorator ID="rfdIndustryAssignment" runat="server" DecoratedControls="All" Skin="Default" DecorationZoneID="divDecoratedZone">
</telerik:RadFormDecorator>
<telerik:RadScriptBlock runat="Server" ID="rsbMain">
    <script type="text/javascript">
        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0)
                args.set_enableAjax(false);
        }
 
        function hideInfoPanel() {
            var ipnl = document.getElementById("<%= divError.ClientID %>");
            ipnl.style.display = 'none';
        }
 
        function PopUpShowing(sender, eventArgs) {
            var popUp = eventArgs.get_popUp();
            var spWorkArea = document.getElementById("s4-workspace");
            var windowHeight = spWorkArea.offsetHeight;
            var windowWidth = spWorkArea.offsetWidth;
            var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
            var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
            if (popUpHeight == "") popUpHeight = 620;
            popUp.style.left = (Math.floor((windowWidth - popUpWidth) / 2) + spWorkArea.scrollLeft).toString() + "px";
            popUp.style.top = (Math.floor((windowHeight - popUpHeight) / 2) + spWorkArea.scrollTop).toString() + "px";
        }
 
        function ShowEditForm(rowIndex, companyPk, overridePk) {
            //enable updatebutton
            $('.btnUpdate').prop('disabled', false);
 
 
            var grid = $find("<%= rgrdIndustryAssignment.ClientID %>");
            var masterTableView = grid.get_masterTableView();
 
            var selectedRows = masterTableView.get_selectedItems();
            // for either checking only 1 row or directly clicking the edit button without checking the row
            if (selectedRows.length < 2) {
                var row = masterTableView.get_dataItems()[rowIndex];
                masterTableView.selectItem(row.get_element(), true);
 
                var companyName = row.get_element().cells[2].innerHTML;
                var othemscott3 = row.get_element().cells[3].innerHTML;
 
                var companyText = $("#<%=lblCompany2.ClientID%>");
                companyText.html(companyName);
                 
                var combo = $find("<%= rcbMacroOTHemscott3.ClientID %>");
                combo.trackChanges();
                combo.showDropDown();
                combo.hideDropDown();
//                var item = combo.findItemByText(othemscott3);
//                item.select();
                combo.set_text(othemscott3);
 
                window.radopen("", "rwEditDialog");
            }
            else {
                for (var i = 0; i < selectedRows.length; i++) {
                    var row = selectedRows[i];
                    var companyPk = row.getDataKeyValue("Company.CompanyPK") || "null";
                    var overridePk = row.getDataKeyValue("CompanyOTHemscottOverride_V1.CompanyOTHemscottOverridePK") || "null";
                    var companyName = row.get_element().cells[2].innerHTML;
                    var isOverriden = true;
                    appendCompanyRow(companyPk, overridePk, companyName, isOverriden);
                }
                window.radopen("", "rwEditMultipleDialog");
            }
            return false;
        }
 
        function appendCompanyRow(companyPk, overridePk, companyName, isOverriden) {
            var data = { companyPk: companyPk, overridePk: overridePk, companyName: companyName, isOverriden: isOverriden };
            var newRow = $("#rowTemplate").render(data);
            $(".multiHeader").after(newRow);
        }
 
        function closeRadWindow() {
        // todo: figure out how to pass radwindow name as a parameter
            $find("<%=rwEditDialog.ClientID%>").close();
            $find("<%=rwEditMultipleDialog.ClientID%>").close();
            return false;
        }
         
        function OnClientBlurHandler(sender, eventArgs) {
            var textInTheCombo = sender.get_text();
            var item = sender.findItemByText(textInTheCombo);
            //if there is no item with that text
            if (!item) {
                //                combo.clearSelection();
                //                combo.set_emptyMessage("Select an item");
                sender.set_text("");
                setTimeout(function () {
                    var inputElement = sender.get_inputDomElement();
                    inputElement.focus();
                    inputElement.style.backgroundColor = "red";
                    inputElement.value = "Select valid item";
                    $('.btnUpdate').prop('disabled', true);
                }, 20);
            }
            else {
                setTimeout(function () {
                    var inputElement = sender.get_inputDomElement();
                    inputElement.focus();
                    inputElement.style.backgroundColor = "transparent";
                    $('.btnUpdate').prop('disabled', false);
                }, 20);
            }
        }
        function OnClientClickedHandler(sender, args) {
            $('.btnUpdate').prop('disabled', true);
        }
        function OnClientLoadHandler(sender) {
            sender.get_inputDomElement().readOnly = "readonly";
        }
 
        function OnClientSelectedIndexChanged(sender, eventArgs) {
            var item = eventArgs.get_item();
            var newPk = item.get_value();
            if (!item) {
                sender.set_text("");
                setTimeout(function () {
                    var inputElement = sender.get_inputDomElement();
                    inputElement.focus();
                    inputElement.style.backgroundColor = "red";
                    inputElement.value = "Select valid item";
                    $('.btnUpdate').prop('disabled', true);
                }, 20);
            }
            else {
                setTimeout(function () {
                    var inputElement = sender.get_inputDomElement();
                    inputElement.focus();
                    inputElement.style.backgroundColor = "transparent";
                    $('.btnUpdate').prop('disabled', false);
                }, 20);
            }
        }
 
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
 
        function CloseAndRebind(args) {
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
        }
 
//        function UpdateIndustryFilters(args) {
//            alert('firing filter event');
 
////            var tableView = $find("<%# (DirectCast(Container, GridItem)).OwnerTableView.ClientID %>");
//            var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
//            alert(tableView);
//            alert(args.get_item().get_value());
//            tableView.filter("MacroOTHemscott3", args.get_item().get_value(), "EqualTo");
//        }
    </script>
    <script id="rowTemplate" type="text/x-jsrender">
        <tr id="" class="hidden">
            <td class="pkColumn" style="visibility: hidden;">      
            </td>
            <td class="companyName">
                {{>companyName}}
            </td>          
        </tr>
    </script>
</telerik:RadScriptBlock>
<style type="text/css">
    /*the following CSS rules take care of expanding the html, body and form elements in case the page content is shorter than the browser window viewport.*/
    html, body, form
    {
        min-height: 100%; /*all except IE6*/
        margin: 0;
        padding: 0;
    }
     
    * html html, * html body, * html form
    {
        height: 100%; /*IE6 only*/
    }
     
    /*the following CSS rule takes care of expanding the RadAjaxLoadingPanel to occupy the full width and height of the browser viewport*/
    .ProgressPanel
    {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        background: #b0dcf0 /*url(loading.gif) center center no-repeat;*/;
    }
     
    .info, .error
    {
        border: 1px solid;
        margin: 10px 0px;
        padding: 15px 20px 15px 50px;
        background-repeat: no-repeat;
        background-position: 10px center;
    }
     
    .info
    {
        color: #00529B;
        background-color: #BDE5F8;
        background-image: url('~/_layouts/images/mewa_infob.gif');
    }
     
    .error
    {
        color: #D8000C;
        background-color: #FFBABA;
        background-image: url('~/_layouts/images/error32by32.gif');
    }
     
    .closeButton
    {
    }
     
    /*These two settings are responsiable for correct dialog height calculation.*/
    .RadGrid .rgEditForm
    {
        height: auto !important;
    }
     
    .RadGrid .rgEditForm > .rgHeader + div
    {
        height: auto !important;
    }
</style>
<div style="text-align: center">
    <div id="divError" runat="server">
        <button type="button" style="float: right; position: relative; padding: 0px 0px 0px 0px;
            border: 0px; background: transparent; opacity: 0.2; font-size: 20px; line-height: 20px;
            font-weight: bold; right: -19px; top: -18px; cursor: pointer;" onclick="hideInfoPanel();">
            ×</button>
        <asp:Label ID="lblError" runat="server" Text=""></asp:Label>
    </div>
</div>
<div id="divDecoratedZone">
    <asp:HiddenField ID="hvCompanyOverrideBag" runat="server" />
    <telerik:RadGrid ID="rgrdIndustryAssignment" runat="server" Skin="Default" AutoGenerateColumns="false"
        AllowFilteringByColumn="True" AllowSorting="True" GroupingEnabled="False" AllowPaging="true" AllowCustomPaging="true"
        PageSize="15" GridLines="None" AllowMultiRowSelection="true" OnItemCreated="rgrdIndustryAssignment_ItemCreated">
        <ClientSettings>
            <ClientEvents OnPopUpShowing="PopUpShowing" />
            <Selecting AllowRowSelect="True"></Selecting>
        </ClientSettings>
        <GroupingSettings CaseSensitive="false"></GroupingSettings>
        <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="CompanyOTHemscottOverride_V1.CompanyOTHemscottOverridePK, Company.CompanyPK, IsOverridden"
            ClientDataKeyNames="CompanyOTHemscottOverride_V1.CompanyOTHemscottOverridePK, Company.CompanyPK, IsOverridden"
            InsertItemPageIndexAction="ShowItemOnCurrentPage">
            <Columns>
                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                </telerik:GridClientSelectColumn>
                <telerik:GridTemplateColumn AllowFiltering="False" ReadOnly="True">
                    <HeaderStyle Width="25px" />
                    <ItemTemplate>
                        <asp:ImageButton ID="ibtnEditAction" ToolTip="Edit" ImageUrl="~/_layouts/images/industry/edit.gif"
                            runat="server" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridCheckBoxColumn UniqueName="IsOverridden" HeaderText="Overridden" DataField="IsOverridden"
                    Visible="false">
                </telerik:GridCheckBoxColumn>
                <telerik:GridBoundColumn UniqueName="CompanyName" HeaderText="Company Name" DataField="Company.CompanyName">
                     
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="MacroOTHemscott3" HeaderText="OTHemscott3" DataField="MacroOTHemscott3.OTHemscott3" AutoPostBackOnFilter="false">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="cbxMacroOTHemscott3" runat="server" OnClientSelectedIndexChanged="MacroOTHemscott3IndexChanged"
                            AppendDataBoundItems="true" Width="220px">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                                <telerik:RadComboBoxItem Text="" Value="" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="rsbMacJTHemsc" runat="server">
                            <script type="text/javascript">
                                function MacroOTHemscott3IndexChanged(sender, args) {
 
                                    var tableView = $find("<%# (DirectCast(Container, GridItem)).OwnerTableView.ClientID %>");
                                    alert(tableView);
                                    if (args.get_item().get_text() == "" && args.get_item().get_value() == "") {
                                        tableView.filter("MacroOTHemscott3", "", "IsEmpty");
                                    }
                                    else {
                                        tableView.filter("MacroOTHemscott3", args.get_item().get_value(), "EqualTo");
                                    }
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="Source" HeaderText="Source" DataField="CompanyOTHemscottOverride_V1.MacroOTHemscott3Source" AutoPostBackOnFilter="false">
                   <FilterTemplate>
                       <asp:DropDownList ID="DropDownList1" runat="server">
                       </asp:DropDownList>
                        <telerik:RadComboBox ID="rcbSource" runat="server" OnClientSelectedIndexChanged="UpdateIndustryFilters" OnSelectedIndexChanged="rgrdIndustry_UpdateFilters"
                            AppendDataBoundItems="true" Width="60px">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="rsb" runat="server">
                            <script type="text/javascript">
                                function UpdateIndustryFilters(sender, args) {
                                    alert('firing filter event');
                                    var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
                                    alert(tableView);
                                    alert(args.get_item().get_value());
                                    tableView.filter("MacroOTHemscott3", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                   </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn UniqueName="Created" HeaderText="Created" DataField="CompanyOTHemscottOverride_V1.Created"
                    FilterControlWidth="180px" EnableTimeIndependentFiltering="true">
                    <HeaderStyle Width="215px"></HeaderStyle>
                </telerik:GridDateTimeColumn>
                <telerik:GridBoundColumn UniqueName="CreatedBy" HeaderText="Created By" DataField="CompanyOTHemscottOverride_V1.CreatedBy">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="rcbCreatedBy" runat="server" OnClientSelectedIndexChanged="rcbCreatedBy_SourceIndexChanged"
                            AppendDataBoundItems="true" Width="150px">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                   </FilterTemplate>
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn UniqueName="Updated" HeaderText="Updated" DataField="CompanyOTHemscottOverride_V1.Updated"
                    FilterControlWidth="180px" EnableTimeIndependentFiltering="true">
                    <HeaderStyle Width="215px"></HeaderStyle>
                </telerik:GridDateTimeColumn>
                <telerik:GridBoundColumn UniqueName="UpdatedBy" HeaderText="Updated By" DataField="CompanyOTHemscottOverride_V1.UpdatedBy">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="rcbUpdatedBy" runat="server" OnClientSelectedIndexChanged="rcbUpdatedBy_SourceIndexChanged"
                            AppendDataBoundItems="true" Width="150px">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                   </FilterTemplate>
                </telerik:GridBoundColumn>
            </Columns>
            <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true">
            </CommandItemSettings>
            <EditFormSettings EditFormType="Template" PopUpSettings-Modal="true" PopUpSettings-Width="600px">
                <FormTemplate>
                    <table id="tblInsertEdit" cellspacing="1" cellpadding="1" width="100%" border="0">
                        <tr>
                            <td style="width: 22%;">
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr id="trEditIndustry" runat="server">
                            <td>
                                Company:
                            </td>
                            <td>
                                <asp:Label ID="lblCompany" runat="server" Width="100%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                OTHemscott3:
                            </td>
                            <td>
                                 
                            </td>
                        </tr>
                        <tr id="trBatchEdit" runat="server" visible="false">
                            <td>
                                Countries:
                            </td>
                            <td>
                                <telerik:RadGrid ID="rgrdCompaniesAndOverrides" runat="server" OnNeedDataSource="rgrdCompaniesAndOverrides_NeedDataSource"
                                    AutoGenerateColumns="false">
                                    <MasterTableView EditMode="InPlace" AllowPaging="true" PageSize="15" DataKeyNames="CompanyOTHemscottOverridePK, CompanyPK, IsOverridden"
                                        ShowHeader="true" PagerStyle-Mode="NumericPages">
                                        <Columns>
                                            <telerik:GridBoundColumn UniqueName="CompanyFullName" HeaderText="Company Name" DataField="CompanyFullName">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridCheckBoxColumn UniqueName="IsOverridden" HeaderText="Is Overridden"
                                                DataField="IsOverridden">
                                            </telerik:GridCheckBoxColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr id="trInsertIndustrySearch" runat="server">
                            <td>
                            </td>
                            <td>
                                <div style="width: 100%;">
                                    <asp:TextBox ID="tbxCompanyFilter" runat="server" Width="380px"></asp:TextBox>
                                    <asp:Button ID="btnSearch" runat="server" Text="Search" CommandName="SearchCompanies" />
                                </div>
                            </td>
                        </tr>
                        <tr id="trInsertIndustry" runat="server">
                            <td>
                                Companies:
                            </td>
                            <td>
                                <telerik:RadGrid ID="rgrdCompaniesToInsert" runat="server" OnNeedDataSource="rgrdCompaniesToInsert_NeedDataSource"
                                    AutoGenerateColumns="false" AllowMultiRowSelection="true">
                                    <ClientSettings>
                                        <Selecting AllowRowSelect="True"></Selecting>
                                    </ClientSettings>
                                    <MasterTableView EditMode="InPlace" DataKeyNames="CompanyPK" AllowPaging="true" PageSize="15"
                                        ShowHeader="false" PagerStyle-Mode="NumericPages">
                                        <NoRecordsTemplate>
                                            No companies to display.</NoRecordsTemplate>
                                        <Columns>
                                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                                            </telerik:GridClientSelectColumn>
                                            <telerik:GridBoundColumn UniqueName="CompanyFullName" DataField="CompanyFullName">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                    </table>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <asp:Button ID="btnSave" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'
                                    runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
                                </asp:Button
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
                <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column">
                </EditColumn>
                <PopUpSettings Modal="True" Width="600px"></PopUpSettings>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
    <telerik:RadWindowManager runat="server" ID="rwmIndustry" EnableShadow="True">
            <Windows>
                <telerik:RadWindow runat="server" ID="rwEditDialog" Title="Editing Record"
                    Height="150px" Width="600px" ReloadOnShow="True" ShowContentDuringLoad="False"
                    Modal="True" Behaviors="Close">
                    <ContentTemplate>
                        <table id="tblInsertEdit" cellspacing="1" cellpadding="1" width="100%" border="0">
                        <tr>
                            <td style="width: 22%;">
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr id="trEditIndustry" runat="server">
                            <td>
                                Company:
                            </td>
                            <td>
                                <asp:Label ID="lblCompany2" runat="server" Width="100%"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                OTHemscott3:
                            </td>
                            <td>
                                <telerik:RadComboBox ID="rcbMacroOTHemscott3" runat="server" Width="100%" AppendDataBoundItems="true"
                                    EnableLoadOnDemand="true" OnItemsRequested="rcbMacroOTHemscott3_ItemsRequested" AllowCustomText="false" MarkFirstMatch="true"
                                    OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" OnClientBlur="OnClientBlurHandler">
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                            <tr>
                                <td></td>
                                <td style="text-align: right">
                                    <telerik:RadButton ID="rbUpdate" runat="server" Text="Update" OnClick="btnUpdate_Clicked" OnClientClicked="OnClientClickedHandler" CssClass="btnUpdate">
                                    </telerik:RadButton>   
                                    <telerik:RadButton ID="rbCancel" runat="server" Text="Cancel" AutoPostBack="false" OnClientClicked="closeRadWindow">
                                    </telerik:RadButton>                                   
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </telerik:RadWindow>
                <telerik:RadWindow runat="server" ID="rwEditMultipleDialog" Title="Editing Records"
                    Height="350px" Width="600px" ReloadOnShow="True" ShowContentDuringLoad="False"
                    Modal="True" Behaviors="Close">
                    <ContentTemplate>
                        <table id="multiEditTable" cellspacing="1" cellpadding="1" width="100%" height border="0">
                            <tr class="multiHeader" style="font-weight:bold">
                                <td>Companies:</td>
                                <td>Company Name</td>
                            </tr>
     
                            <tr >
                                <td style="font-weight:bold">OTHemscott3:</td>
                                <td>
                                    <telerik:RadComboBox ID="rcbMacroOTHemscott3Multiple" runat="server" Width="100%" AppendDataBoundItems="true"
                                        EnableLoadOnDemand="true" OnItemsRequested="rcbMacroOTHemscott3_ItemsRequested" AllowCustomText="false" MarkFirstMatch="true"
                                        OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" OnClientBlur="OnClientBlurHandler">
                                    </telerik:RadComboBox>                                   
                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td style="text-align: right">
                                    <telerik:RadButton ID="rbUpdateMultiple" runat="server" Text="Update" OnClick="btnUpdate_Clicked" OnClientClicked="OnClientClickedHandler" CssClass="btnUpdate">
                                    </telerik:RadButton>   
                                    <telerik:RadButton ID="rbCancelMultiple" runat="server" Text="Cancel" AutoPostBack="false" OnClientClicked="closeRadWindow">
                                    </telerik:RadButton>                                   
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager>
     
</div>

Thanks in Advance!

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 07 Jan 2016, 01:18 PM
Hello Nick,

Could you please try running the attached sample website. At my end the tableView variable in your UpdateIndustryFilters handler holds a valid reference and does not return null (with the specified version 2015.3.1111 of our controls and the 2013.2.717 one referenced in the code you posted).
As for adding a server-side handler for the ComboBox' OnSelectedIndexChanged event, since the control is not created in the code-behind but in the markup, you can subscribe to the event in the markup omitting the Handles clause in the code-behind as demonstrated in the sample project.

Regards,
Ivan Danchev
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
ComboBox
Asked by
nick
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or