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
I have a webgrid with clientbinding and paging which is connected a ISLinqDataSource (Datasource is Entity Framework).
I would like to return filtered data, but i cant use "filter column" property because of the design and security issues (for example: user may unhide hidden column and clear filter, or i can't apply more than one filter for a single column like "code like 'a%' or code like 'b%' ").
And i cant use ISLinqDataSource's where property as WebGrid overrides it.
So i dediced to use FilteredColumns.AdvancedFilterExpression property.
It runs but has one important problem:
AdvancedFilterExpression is applied not while querying database, but applied after retrieving data by WebGrid. So if you set paging with 25 rows, you may see less than 25 rows in a pages, even may be all pages with no rows.
In a ClientBindind scenario, please use ClientBindingSettings ServiceEvents Selecting to add custom filter. This way the filter argument will be used during the data selecting (Paging will be taken into account)
Using the ClientBinding_Paging.aspx sample, add ServiceEvents Selecting. WebGrid Definition:
<ClientBindingSettings DataLoadMode="PagedData" DataSourceType="WebService" ItemTypeName="Bug" ServiceUrl="WebService.asmx"> <ServiceMethods BatchUpdateMethod="UpdateBugs" SelectMethod="GetPagedBugs" /> <ServiceEvents Selecting="WebGrid1_DataSelecting" /> </ClientBindingSettings>
Here is the event handler snippet, all filter action will filter the data which has Target value similar to fut or bug:
function WebGrid1_DataSelecting(gridObj, selectArgs) { if (selectArgs.FilterExpression != "") selectArgs.FilterExpression = "[Target] like 'fut' or [Target] like 'bug'"; }
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