DropDownDataGrid setting selection

I have an add and edit page populating a SQL table. The pages use a DropDownDataGrid to allow selection of a foreign key value to be inserted as part of the record. It works perfectly when adding but, when loading the edit page, I don't seem to be able to find a way to set an initial selection within the DropDownDataGrid that works 100% of the time.

If I set the page property which is bound to the Value of the DropDownDataGrid it works perfectly but, only as long at the initial selection is on page 1 of the data in the DropDownDataGrid. If the selection is on, for example, page 5, nothing seems to be getting selected.

Is there a way to accomplish this?

Thank you.

Hi @markb,

You can check the code generated by our CRUD pages template:


I can confirm this issue as well. When using the edit form generated by radzen, it does not selects the value from the model / db and show it in the lookup control.

Radzen support team please check this.

Thanks

To the best of our knowledge both DropDown and DropDownDataGrid will select the item in edit form. Check the code of your page.

I was having the same issue with the lookuppopup. I think I finally found the answer (at least it works so far). I changed the order of execution for the Load event for the page. The order generated by the CRUD template has it doing the lookup for the lookuppopup last. I moved it to the top so that the lookup for the lookuppopup is done before it loads the record to be edited. The code that gets the record to be edited sets the property for what the lookuppopup should have selected but it occurs before the lookuppopup has been populated so there was nothing to select. Hope this helps.