iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
When PagingMode is set to None, the phrase "Loaded x of x" displays in the bottom right of the grid, both in filtered and non-filtered scenarios. When, however, PagingMode is set to some value other than None, that text disappears and is replaced with the paging control. How do we display the number of filtered rows while also allowing paging?
Brad
A workaround if you would like to use classic paging would be to retrieve the filtered row count during InitializePostBack server side event handler and invoke javascript function to render the information. Here is the snippet, the client side snippet will try to render a new TD element in the WebGrid status bar:
//Server codeprotected void wgTest_InitializePostBack(object sender, PostbackEventArgs e){ switch (e.Action) { case "ColumnFilter": int filterCount = ((System.Data.DataTable)(wgTest.DataSource)).DefaultView.Count; wgTest.ClientAction.InvokeScript("RenderFilterCount", new FunctionParameter[] { new FunctionParameter(filterCount.ToString(), "string")}); break; }}
//Client side codefunction RenderFilterCount(count){ var grid = ISGetObject("wgTest"); var customStat = document.getElementById("tdCustomStat_" + grid.Id); if (customStat) { customStat.getElementsByTagName("div")[0].innerHTML = "Filtered row: " + count; } else { var statBar = grid.GetElement(WG40.STATUSBAR, WG40.HTMLCELL); var filterCountDiv = document.createElement("div"); filterCountDiv.innerHTML = "Filtered row: " + count; var filterCountDivCont = document.createElement("td"); filterCountDivCont.setAttribute("id", "tdCustomStat_" + grid.Id); filterCountDivCont.setAttribute("noWrap", "nowrap"); filterCountDivCont.appendChild(filterCountDiv); var sepElem = statBar.nextSibling; sepElem.parentNode.insertBefore(filterCountDivCont, sepElem); sepElem.parentNode.insertBefore(sepElem.cloneNode(true), filterCountDivCont); } }
The “Loaded x of y” information that showed in WebGrid status bar will be replaced by ClassicPaging UI (FirstPrevNextLast style; SimpleDropDown style; Slider style) when PagingMode is set to “ClassicPaging”.
If PagingMode is set either to “None” or “VirtualLoad”, the “Loaded x of y” information will still available in WebGrid status bar. So, the most suitable solution for your required scenario, to display the number of filtered rows while also allowing paging, is by using VirtualLoad paging.
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname