Ticket T154898
Visible to All Users

CustomRowFilter is not raised

created 11 years ago

Hello,

In order to hide protected content row I submit a question and got the answer.

https://www.devexpress.com/Support/Center/Question/Details/T152763

C#
using System; using System.Linq; using System.Text; using DevExpress.ExpressApp; using DevExpress.Data.Filtering; using System.Collections.Generic; using DevExpress.Persistent.Base; using DevExpress.ExpressApp.Utils; using DevExpress.ExpressApp.Layout; using DevExpress.ExpressApp.Actions; using DevExpress.ExpressApp.Editors; using DevExpress.ExpressApp.Templates; using DevExpress.Persistent.Validation; using DevExpress.ExpressApp.SystemModule; using DevExpress.ExpressApp.Model.NodeGenerators; using DevExpress.ExpressApp.Win.Editors; using DevExpress.XtraGrid.Views.Grid; using DevExpress.ExpressApp.Security; namespace CL.Module.Controllers { // For more typical usage scenarios, be sure to check out http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppViewControllertopic. public class HideProtectedContentRowsController : ViewController<ListView> { protected override void OnViewControlsCreated() { base.OnViewControlsCreated(); GridListEditor gridListEditor = View.Editor as GridListEditor; if (gridListEditor != null) { gridListEditor.GridView.CustomRowFilter += GridView_CustomRowFilter; } } void GridView_CustomRowFilter(object sender, DevExpress.XtraGrid.Views.Base.RowFilterEventArgs e) { GridView gridView = (GridView)sender; object obj = gridView.GetRow(gridView.GetRowHandle(e.ListSourceRow)); if (!SecuritySystem.IsGranted(new ClientPermissionRequest(obj.GetType(), null, ObjectSpace.GetObjectHandle(obj), SecurityOperations.Read))) { e.Visible = false; e.Handled = true; } } protected override void OnDeactivated() { base.OnDeactivated(); GridListEditor gridListEditor = View.Editor as GridListEditor; if (gridListEditor != null) { gridListEditor.GridView.CustomRowFilter -= GridView_CustomRowFilter; } } } }

In my small sample CustomRowFilter is raised, but in my real project CustomRowFilter is not raised

Please find the attached SWF. Would you please tell me how to solve it?

Thanks
Wangbei

Show previous comments (14)

    Hello Michael,
    Yes T152763 solved calculation problem using custom provider. Which will cause many update work for my delivered projects. Now five of my project face this problem.
    So I still intend to get a better way to hide entire row of protected content in UI level for server mode. If it could be done, update of my current project will be easy. I have over hundreds of calculation field to handle. I still do not know the performance which need test.
    BRGDS/Wangbei

    DevExpress Support Team 11 years ago

      I'm afraid there's no simpler solution. As it is mentioned in the Server Mode Limitations article, the CustomRowFilter event doesn't work in server mode and the grid doesn't provide other means to filter data by a custom code-based criterion.

        Thanks Michael.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.