Disallow field change

3 posts, 1 answers
  1. VaL
    VaL avatar
    27 posts
    Member since:
    Oct 2017

    Posted 02 May 2018 Link to this post

    Hello,

    I'm creating a DataFilter showing a premade expression and not allowing to Add or Remove other expressions or groups.

    I'd like also to disable the possiblity to click on a field and change it, I want to keep them fixed.

    I've seen the AllowEdit property, but it's too drastic, since it does not allow even to change the value to look for.

    Where should I look?

    Thank you!

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 02 May 2018 Link to this post

    Hello Valerio,

    You can handle the Editing event and cancel it for the DataFilterFieldEditorElement object. In  a similar way, you can also cancel the edit operation for the other elements as well: 
    private void RadDataFilter1_Editing(object sender, TreeNodeEditingEventArgs e)
    {
        if (sender is DataFilterFieldEditorElement)
        {
            e.Cancel = true;
        }
     
        //Cancels editing of the filter operator
        if (sender is DataFilterOperatorEditorElement)
        {
            //e.Cancel = true;
        }
     
        //Cancels editing of the value element
        if (sender is DataFilterValueEditorElement)
        {
            //e.Cancel = true;
        }
    }

    You can also check the Events documentation article in the Editing section: https://docs.telerik.com/devtools/winforms/datafilter/editing/events.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. VaL
    VaL avatar
    27 posts
    Member since:
    Oct 2017

    Posted 02 May 2018 Link to this post

    Great!

    Thanks Hristo!

Back to Top