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
How do I set the default filter for a column to "like"?
How do I remove the filter icons from the columns?
To set default filter type, for example to “like”, on a specific column please try to specify filtered columns in the RootTable of WebGrid. The snippet code below shows how to set default filter type to “like” on “CompanyName” column.
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" DataSourceID="AccessDataSource1" Height="250px" UseDefaultStyle="True" Width="500px"> <LayoutSettings AllowFilter="Yes"> </LayoutSettings> <RootTable DataKeyField="SupplierID"> <Columns> <ISWebGrid:WebGridColumn Caption="SupplierID" DataMember="SupplierID" DataType="System.Int32" Name="SupplierID" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="CompanyName" DataMember="CompanyName" Name="CompanyName" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ContactName" DataMember="ContactName" Name="ContactName" Width="100px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="ContactTitle" DataMember="ContactTitle" Name="ContactTitle" Width="100px"> </ISWebGrid:WebGridColumn> </Columns> <FilteredColumns> <ISWebGrid:WebGridFilter ColumnMember="CompanyName" FilterType="NotLike" /> </FilteredColumns> </RootTable> </ISWebGrid:WebGrid>
In order to remove the filter icons from the columns, you need to access the image element of the filter icon and then set its display property to “none”. The snippet of script below shows how to remove filter icon from cell with index number 5 in WebGrid filter row.
function WebGrid1_OnInitialize(controlId) { var WebGrid1 = ISGetObject(controlId); var FilterRow = WebGrid1.RootTable.GetFilterRow(); FilterRow.cells[5].childNodes[1].style.display = "none"; return true; }
Thanks for the reply; however, I would like to hide it on server side.
Unfortunately, currently there is no way to hide filter icon from server side code. The only available option for this time is by accessing the image element and hides it. You can run the script from server side by invoking “InvokeScript” method.
I have forwarded this to WebGrid development team as feature request. They will check the feasibility to implement this feature in the upcoming build of WebGrid 7.
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