Hi,
I am trying to show/hide the filter row on the grids initial load. I have the following script set and based on the alert messages the code is running correctly but the filter row isn't being displayed when it should be.
Can you tell me what I am missing.
Thanks for you assistance.
Tracy
I am trying to show/hide the filter row on the grids initial load. I have the following script set and based on the alert messages the code is running correctly but the filter row isn't being displayed when it should be.
Can you tell me what I am missing.
Thanks for you assistance.
Tracy
function GridInitialLoad(sender, eventArgs) { var masterTable = sender.get_masterTableView(); var rbtFilter = $telerik.findControl(sender.get_element(), "rbtFilters"); var i = 0; var result; var toggleList; if (rbtFilter) { toggleList = rbtFilter.get_selectedToggleStateIndex(); switch (toggleList) { case 0: rbtFilter.set_toolTip('Show Filter Row'); masterTable.hideFilterItem(); alert('hide'); break; case 1: rbtFilter.set_toolTip('Hide Filter Row'); masterTable.showFilterItem(); alert('show'); break; } } var rbtGroup = $telerik.findControl(sender.get_element(), "rbtGrouping"); if (rbtGroup) { toggleList = rbtGroup.get_selectedToggleStateIndex(); switch (toggleList) { case 0: rbtGroup.set_toolTip('Show Group Panel'); result = $telerik.$(".rgGroupPanel"); for (i = 0; i < result.length; i++) { result[i].className = "hideGroupPanel"; } break; case 1: rbtGroup.set_toolTip('Hide Group Panel'); result = $telerik.$(".hideGroupPanel"); for (i = 0; i < result.length; i++) { result[i].className = "rgGroupPanel"; } break; } } }<telerik:RadGrid ID="rgvMainGrid" runat="server" DataSourceID="SQLDS_EmailAddresses" EnableEmbeddedSkins="true" Skin="Office2010Silver" EnableAjaxSkinRendering="true" Height="550px" Width="1230px" EnableViewState="true" AutoGenerateColumns="false" AllowMultiRowSelection="false" AllowFilteringByColumn="true" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" ShowGroupPanel="true" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowSorting="true" EnableLinqExpressions="false" AllowPaging="true" PageSize="100" > <ItemStyle Wrap="true" /> <AlternatingItemStyle Wrap="true" /> <ActiveItemStyle BackColor="CornflowerBlue"/> <EditItemStyle Font-Size="10px" /> <HeaderStyle HorizontalAlign="Center"/> <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced"/> <EditItemStyle BackColor="CornflowerBlue"/> <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder" AllowDragToGroup="true" EnablePostBackOnRowClick="false" EnableRowHoverStyle="false" > <ClientEvents OnGridCreated="GridInitialLoad" OnRowSelected="SetSelectedItem" /> <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" AllowRowResize="false" /> <Selecting AllowRowSelect="true"/> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings> <GroupHeaderItemStyle Font-Size="11px" Font-Names="calibri" Font-Bold="true" Height="12px"/> <MasterTableView Name="Users" DataSourceID="SQLDS_EmailAddresses" DataKeyNames="EmailAddressID, EmailName" ClientDataKeyNames="EmailAddressId, EmailName" Width="1213px" EnableViewState="true" EditMode="InPlace" CommandItemDisplay="Top" TableLayout="Fixed" EnableGroupsExpandAll="true" GroupLoadMode="Client" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true" > <NoRecordsTemplate>There are no records that match the criteria you selected!</NoRecordsTemplate>