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

Access Root Logical Operator value

1 Answer 64 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
O
Top achievements
Rank 1
O asked on 10 Feb 2017, 05:54 PM

 

How do you get access to the Root Logical Operator value? For example, I want to do this

 

            RadDataFilterDialog dialog = new RadDataFilterDialog();
            dialog.ShowDialog();
            //string expression = dialog.DataFilter.Expression;

            //Doesn't work
            DataFilterRootNode dfRn = dialog.DataFilter.Nodes[0] as DataFilterRootNode;
            if (dfRn != null)
            {
                var rootLogicalOperator = dialog.DataFilter.Nodes[0].LogicalOperator;
            }

            //Doesn't work
            var rootLogicalOperator = dialog.DataFilter.Nodes[0].LogicalOperator;

 

dialog.DataFilter.Nodes[0] in the debugger indicates it's of type DataFilterRootNode but if I try to cast to that type to access the LogicalOperator value it gives error Error    CS0122    'DataFilterRootNode' is inaccessible due to its protection level

 

So how do I access the root LogicalOperator value?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Feb 2017, 12:33 PM
Hello,

You can use the following code for this:
RadDataFilterDialog dialog = new RadDataFilterDialog();
 
dialog.DataSource = GetTable();
dialog.ShowDialog();
 
DataFilterGroupNode dfRn = dialog.DataFilter.Nodes[0] as DataFilterGroupNode;
if (dfRn != null)
{
    var rootLogicalOperator = dfRn.LogicalOperator;
}

The DataFilterRootNode class will be exposed in the next official release.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
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.
Tags
DataFilter
Asked by
O
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or