How to filter two nested DropDowDataGrid controls in Add/Edit TemplateForm

#1

Hello,

I need to filter "Cidade" by "Estado" in TemplateForm, how can I do this?

Thanks.

0 Likes

#2

Hi @marden.

Please check this thread:

0 Likes

#3

Hello @enchev,

I already read this topic, but I'm completely lost, could you make a video showing how to do this task?
below is all my project with database, could you use it to show me how to do?

https://drive.google.com/open?id=1na4QVEXUypZ0qcinbF177ovPBBH8A_Zg

Thank you.

1 Like

#4

You need to set $filter parameter for the second DropDown data-source method invoke to use the selected value of first DropDown. Which part is difficult for you? To set the filter parameter or to get the selected value from first lookup?

0 Likes

#5

Both, I'm very new to Radzen and I'm lost, I've already watched all the videos that are available and not have any video that teach to do something like this.

0 Likes

#6

Selected value from a lookup can be accessed from the object bound to the form. For example: ${orderdetail.OrderID}

here is also how to set $filter parameter

0 Likes

#7

Hello @enchev,
I did this

but now when i click in a record for edit the field "Cidade" is null

I'm really confuse how to make this work

I returned to the state I was in before

Event LoadData from Form
image

Event Load from page


image

Where should I make the changes to work?

0 Likes

#8

I highly support this. Making cascade of lookup fields is going to boost my apps. Thanks.

0 Likes

#9

@marden I am attaching a working version of cascading dropdowns.

A few observations:

1.The EstadoId column is a string which is why you have to use quotes in filter expressions e.g. EstadoId eq '${event.property}'
2. The UpdateDataOnChange property of the form should be checked so the oportunidade page property stays up to date.
3. The getCidades method should be invoked in the Then event of getOpportunidadeById so we can use ${opportunidade.EstadoId} to initially filter.
4. The Change event of the form is handled to filter when the user changes EstadoId.
5. The LoadData event is modified to use the current ${oportunidade.EstadoId} to filter.

edit-oportunidade.json.zip (2.1 KB)

0 Likes

#10

Hello Marden, did you get it work?

0 Likes

#11

Hello @leam.mx

I still have not got it and I gave up for now, I need to study Radzen to understand how it works in more complex cases like this, at the moment I'm out of time, Radzen's team support is spectacular, even though I'm not a Radzen Professional user they are still answer my doubts.

When I have enough time I will go back to studying Radzen

0 Likes

#12

Exactly the same for me. I Hope Radzen's team could make a video soon. Excited making this with an embedded highchart and as a cordova app all with Radzen! Thanks.

0 Likes

#13

@marden the file I have attached is supposed to be a drop-in working replacement. I also described what I have changed in it to make it work.

0 Likes