This is a migrated thread and some comments may be shown as answers.

Disallow field change

2 Answers 15 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
VaL
Top achievements
Rank 1
VaL asked on 02 May 2018, 10:19 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 02 May 2018, 11:09 AM
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.
0
VaL
Top achievements
Rank 1
answered on 02 May 2018, 01:06 PM

Great!

Thanks Hristo!

Tags
DataFilter
Asked by
VaL
Top achievements
Rank 1
Answers by
Hristo
Telerik team
VaL
Top achievements
Rank 1
Share this question
or