Dropdown Filter

I'm trying to filter a Radzen Generated Table that has an Active-Inactive column (Foreign key column )from a Dropdown, I've followed all the tutorials, and isn't working. is there any other resources.

Thanks

What property is used for this column FilterProperrty? Here is how it looks usually:

To display also related data you will need $expand parameter

I'm trying to filter the table to the active Status, hide the status column, then toggle from active to inactive from the dropdown.

What's the Status column definition?

Which one is the definition?


(upload://fxXVVDHycizZk15F1CC339uCMtw.jpeg)

The first screenshot is the column definition/properties. I'm not sure about the second screenshot - where is the DropDown?

here is the dropdown

Instead Data Source Method Invoke on DropDown Change event you can just set a Page property (for example Status) with the changed value and execute load() method for the DataGrid. You can use the DataGrid LoadData event to retrieve the data and include Status page property in $filter using Query Builder:

DropDown Change will set Page property

DataGrid bound to Orders with related entities included


Create query for DataGrid LoadData

Add CustomerID Page property to $filter

Reload DataGrid on DropDown Change


Now you can remove Customer column and filter Employee column by LastName

Got it Working though the datagrid doesn't load data until the dropdown is toggled

Thanks

If you have Placeholder for the DropDown there will be no item selected initially and when you choose something the DataGrid will be reloaded.

Still not getting the Data to load. I think it is the filter, as everything else seems to work but this. also, I removed the '-' brackets off from your example, it wouldn't work otherwise.


According to the URL ActiveStatusID is not defined - you need to define it before executing load() for the grid. Not sure about the brackets, in my example I’ve used single quotes since in my case the type of the property is was string. I’ve noticed also that you removed the grid filter part from the query builder and the column filtering will not work. Please check my example - both filters are combined with AND.

I started over

I set the property ActiveStatusId (FK in Facility Table int) and Value ${event.Id} (PK in ActiveStatus Table int). Ive also tried using ${ActiveStatusId} for the value

then set the Filter to ActiveStatusId equals ${ActiveStatusId}

I aslo tried ActiveStatus.Status for the Property or the Status Column

Still wont load data into the table. Still getting ActiveStatusId undefined, how do you define it.

Thanks

Hi Rob,

Please define Placeholder for the DropDown or you will need to set initial value for the ActiveStatusId on Page Load before everything else.

What should that be, I've tried Active, 'Active', blank, Status, ActiveStatus.Status, ${ActiveStatusID}

Thanks

ActiveStatusId most probably is a number (integer probably) How many status types you have? Active and Inactive?

There are 2 statuses Active, Inactive. Id is an int

In this case since you want to have initial value selected in the DropDown and the DataGrid should be filtered according to the selection you can set on Page Load ActiveStatusId to the first Id - please check the value in your table with status types. Other possible approach will be to set Placeholder for the DropDown. In this case you will not have initial value selected and the grid will be loaded on DropDown Change. Please make sure also you do not call load() for the grid on Page Load.

In this case since you want to have initial value selected in the DropDown and the DataGrid should be filtered according to the selection you can set on Page Load ActiveStatusId to the first Id - please check the value in your table with status types.

set on Page Load ActiveStatusId to the first Id.. Whats the Code look like,

and do these settings look right.

I've made an example app to illustrate you how to have initial DropDown value and filter DataGrid based on this value.