Problem with new version of telerik and radfilters

4 posts, 0 answers
  1. Paulo
    Paulo avatar
    2 posts
    Member since:
    Mar 2012

    Posted 12 Sep Link to this post

    Greetings,

    As per a previous ticket, in a page we're disabling the ability for users to change the expressions in a radfilter, other than the values and the condition type (contains, starts with, etc).

    To do that, we're using, as suggested, in the ExpressionItemCreated event the code:

    if (e.Item is RadFilterGroupExpressionItem)
                    {
                        RadFilterGroupExpressionItem groupItem = e.Item as RadFilterGroupExpressionItem;
                        groupItem.RemoveButton.Visible = (sender as RadFilter) == FilterChoice;
                        groupItem.AddExpressionButton.Visible = (sender as RadFilter) == FilterChoice;
                        groupItem.AddGroupExpressionButton.Visible = (sender as RadFilter) == FilterChoice;
                        groupItem.GroupOperationChooserLink.Enabled = (sender as RadFilter) == FilterChoice;
                    }
    
                    if (e.Item is RadFilterSingleExpressionItem)
                    {
                        RadFilterSingleExpressionItem singleItem = e.Item as RadFilterSingleExpressionItem;
                        singleItem.FieldNameChooserLink.Enabled = (sender as RadFilter) == FilterChoice;
                        singleItem.RemoveButton.Visible = (sender as RadFilter) == FilterChoice;
                    }

    This was working perfectly until we've upgraded to the latest version (due to the security warning you sent). Since then, the dropdown to select the field name and to select And/Or are enabled, even though the code suffered no changes.

    We really need to disable these options. Please advise. Thank you.

    Best Regards,

    Nuno Cabrinha

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3916 posts

    Posted 14 Sep Link to this post

    Hello Nuno,

    I am attaching an example of how to disable certain links (menus) in the filter row. Here is the approach:

    1. in the server code, set a custom CSS class on the links you want to disable, so you can discern them later
    2. with JavaScript, cancel the mouse events on those links. Make sure to do that when necessary. My sample does that on full page postbacks, so you may want to remove the Sys.Application.remove_load() call to handle AJAX requests that include the filter.
    3. optionally, style the link with CSS (e.g., add opacity or change the color).

    The Enabled property of an asp:Hyperlink does the following:

    • removes its href attribute
    • sets its CssClass to aspNetDisabled

    Thus, it should be considered a fluke that this ever worked for a complex control like ours that relies on JavaScript and handling events to operate.

    On a side note, would you agree that I move this thread to the public forums in case other people have a  similar question in the future?

    Regards,

    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Paulo
    Paulo avatar
    2 posts
    Member since:
    Mar 2012

    Posted 18 Sep Link to this post

    Hello Marin,

    The solution proposed seems to be working well, but I would like to also hide the little triangle that suggests a dropdown selection. Is this possible?

    You can move this to the forums if you think it will be helpful to others.

    Regards,

    Nuno Cabrinha

  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3916 posts

    Posted 19 Sep Link to this post

    Hi Nuno,

    I have moved this thread to the forums, thank you for your contribution to the community.

    As for hiding the arrow - you can do that with CSS by cascading through the custom class. Below is the change and I am also attaching the modified page as runnable reference.

    /*lighweight render mode*/
    a.rfField.disableMe:before
    {
        content: "";
    }
     
    /*classic render mode*/
    a.rfField.disableMe:hover
    {
        background-image: none;
    }


    Regards,

    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top