or


<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="40" CellSpacing="0" DataSourceID="entityDsAutoJoinLog" GridLines="None" Height="100%" OnItemDataBound="RadGrid1_ItemDataBound" AllowAutomaticUpdates="true" ><ClientSettings EnableRowHoverStyle="true" > <Scrolling AllowScroll="true" UseStaticHeaders="true" /></ClientSettings> <MasterTableView AutoGenerateColumns="False" DataKeyNames="CLIENT_CLASS, KEY_VALUE" DataSourceID="entityDsAutoJoinLog" > <Columns> <telerik:GridCheckBoxColumn UniqueName="Parent" />...protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { CheckBox chkBoxParent = (CheckBox)dataBoundItem["Parent"].Controls[0]; chkBoxParent.Enabled = true; int index = dataBoundItem.ItemIndex; chkBoxParent.Attributes.Add("onclick", "check('" + index + "')"); } }function check(index) { var grid = $find("<%= RadGrid1.ClientID %>"); var MasterTable = grid.get_masterTableView(); var row = MasterTable.get_dataItems()[index]; var cell = MasterTable.getCellByColumnUniqueName(row, "Parent"); if (cell.innerHTML == "True") { alert('TRUE'); } }| <telerik:GridCheckBoxColumn HeaderText="Truck" DataField="Truck_" DataType="System.Boolean"> |
| </telerik:GridCheckBoxColumn> |
| GridEditableItem editedItem = e.Item as GridEditableItem; |
| bool TruckCheckBox = ((CheckBox)editedItem["Truck_"].Controls[0]).Checked; |
Dim lnqMerchSellers = db.usp_MER_Sellers_GetAll(drpStatus.SelectedValue, iSelectedCountryGroup, PageHelper.getUserAccessLevel(Profile.License, HttpContext.Current.User.Identity.Name, "Merchandise").ToString())rgdMerchSellerList.DataSource = lnqMerchSellers<asp:SqlDataSource ID="sqlUserList" runat="server" ConnectionString="<%$ ConnectionStrings:AU_Deals_ConnectionString %>" SelectCommand="usp_MER_Sellers_GetAll" SelectCommandType="StoredProcedure" />sqlUserList.SelectParameters.Clear()sqlUserList.SelectParameters.Add("filter", DbType.Int32, drpStatus.SelectedValue)sqlUserList.SelectParameters.Add("countryGroupID", DbType.Int32, iSelectedCountryGroup.ToString())sqlUserList.SelectParameters.Add("accessLevel", DbType.String, PageHelper.getUserAccessLevel(Profile.License, HttpContext.Current.User.Identity.Name, "Merchandise").ToString())rgdMerchSellerList.DataSource = lnqMerchSellers
<telerik:RadWindow ID="RdWndw_AddEdit" runat="server" AutoSizeBehaviors="Width, Height" CssClass="Styles/Window.css" AutoSize="true" VisibleStatusbar="false" Behaviors="Move" VisibleOnPageLoad="false" ReloadOnShow="true" Modal="true" NavigateUrl="Popup_Add.aspx" OnClientClose="OnAddEditClose" EnableShadow="true"></telerik:RadWindow><telerik:RadWindow ID="RdWndw_AddNewExtra" runat="server" AutoSizeBehaviors="Width, Height" AutoSize="true" VisibleStatusbar="false" Behaviors="Move" VisibleOnPageLoad="false" ReloadOnShow="true" Modal="true" NavigateUrl="Popup_AddNewExtra.aspx" OnClientClose="OnAddNewExtraClose" EnableShadow="true"></telerik:RadWindow>function OpenAddEdit() { var wnd = $find("<%=RdWndw_AddEdit.ClientID %>"); wnd.show();} function OpenAddExtraField() { var wnd = $find("<%=RdWndw_AddNewExtra.ClientID %>"); wnd.show();}<telerik:RadButton ID="RadButton3" runat="server" Text="Add new field" OnClientClicked="CallOpenAddExtraFieldOnParent" CommandName="newField"></telerik:RadButton>function CallOpenAddExtraFieldOnParent(sender, args) { PageMethods.SetAddNewTypeFlag(sender.get_commandName()); GetRadWindow().BrowserWindow.OpenAddExtraField();}When utilizing the context menu filtering it works fine for adding 1 filter. If you do another action, like sort or add another filter, it keeps the previous filter but doesn't show it in the menu. If you click "Clear Filter" it does clear the filter that you don't see and refreshes the grid as you would expect. It doesn't do this in the Telerik demo, so I'm thinking there's something wrong with my code or there's been a fix since the Telerik build we're using (2013.2.717.35). Any ideas? Thanks.
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /><telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> var cancelAjax = false; function RequestStart(sender, eventArgs) { if ((eventArgs.get_eventTarget() == "ctl00$ContentPlaceHolder1$ShipClassGridView$ctl00$ctl02$ctl00$WirsRadToolBar") && (cancelAjax)) { eventArgs.set_enableAjax(false); } else eventArgs.set_enableAjax(true); }
function OnClientButtonClickingHandler(sender, eventArgs) { if (eventArgs.get_item().get_value() == "NoAjax") { cancelAjax = true; } } function ShowColumnHeaderMenu(ev, columnName) { var grid = window.$find("<%=ShipClassGridView.ID %>"); var columns = grid.get_masterTableView().get_columns(); for (var i = 0; i < columns.length; i++) { if (columns[i].get_uniqueName() == columnName) { columns[i].showHeaderMenu(ev, 75, 20); } } } </script></telerik:RadCodeBlock><telerik:RadGrid ID="ShipClassGridView" runat="server" AllowAutomaticDeletes="false" EnableViewState="false" Visible="true" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" EnableAJAX="true" GroupingEnabled="false" Skin="WIRS" EnableEmbeddedSkins="false" GridLines="None" OnItemCommand="ShipClassGridView_ItemCommand" OnNeedDataSource="ShipClassGridView_NeedDataSource" GroupingSettings-CaseSensitive="false" AllowSorting="True" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" AllowFilteringByColumn="true" EnableLinqExpressions="false" OnItemDataBound="ShipClassGridView_OnItemDataBound" AutoGenerateColumns="False"> <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true"> <Excel Format="Biff" /> </ExportSettings> <MasterTableView DataKeyNames="Id" IsFilterItemExpanded="false" AllowFilteringByColumn="true" CommandItemDisplay="Top" EnableNoRecordsTemplate="true"> <NoRecordsTemplate> No results found for the selected ship class.</NoRecordsTemplate> <CommandItemTemplate> <telerik:RadToolBar runat="server" EnableEmbeddedSkins="false" Skin="WIRS" ID="WirsRadToolBar" Width="100%" OnClientButtonClicking="OnClientButtonClickingHandler" OnButtonClick="WirsRadToolBar_ButtonClick"> <Items> <telerik:RadToolBarButton Text="Export to Excel" Value="NoAjax" CommandName="ExportExcel" ImageUrl="../images/Toolbar/xls.gif" /> <telerik:RadToolBarButton Text="Export to PDF" Value="NoAjax" CommandName="ExportPdf" ImageUrl="../images/Toolbar/pdf.gif" /> </Items> </telerik:RadToolBar> </CommandItemTemplate> <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToPdfButton="true" /> <Columns> <telerik:GridBoundColumn DataField="Id" HeaderText="Id" SortExpression="Id" AllowFiltering="false" Visible="false" /> <telerik:GridTemplateColumn HeaderText="Hull Number" DataField="Hull" DataType="System.String" SortExpression="Hull"> <ItemTemplate> <asp:Label ID="HullLabel" runat="server" Text='<%# Eval("Hull") %>' Style="position: relative; top: -3px;"></asp:Label> <asp:Image ID="ImageHullNo" runat="server" ImageUrl="../images/New/eo_web.ashx.gif" Visible="false" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" /> <telerik:GridDateTimeColumn HeaderText="Last Modified" DataField="LastUpdateDate" SortExpression="LastUpdateDate" DataFormatString="{0:d}" UniqueName="LastUpdateDate" PickerType="None" /> <telerik:GridBoundColumn DataField="ModifiedByDisplayName" HeaderText="Last Modified By" SortExpression="ModifiedByDisplayName" /> <telerik:GridNumericColumn HeaderText="Total Records" DataField="WirsRowCount" SortExpression="WirsRowCount" UniqueName="WirsRowCount" /> <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Ship Status"> <ItemTemplate> <asp:Label ID="RecordStatusLbl" runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true" Resizing-AllowColumnResize="true" AllowColumnsReorder="true" /></telerik:RadGrid>