I'm creating a Radzen demo for my company as a possible data entry system.
I've connected our ms sql server DB as a data source and have successfully created the CRUD pages I need. However, when I try to add an entry in the data grid, I expected the foreign keys to populate with ids in the entry dropdown.
I've done some research on my own and everything I've found requires some multi step coding change.
Simply put, how can I populate this dropdown with the correct foreign ids?
Yes, If I have two tables, one with primary key A and another table with foreign key F that references primary key A from the first table, I expected the data grid drop down to populate with the possible values of Primary key A, such that I can create new entries in the second table that satisfy the constraint.
If I have a Colors table with ColorID and Color Name
and a Fruits table with FruitID ColorID etc, where ColorID is a foreign key constraint and references Colors.
I'd like to be able to show table Fruits in a datagrid and be able to create new entries in the Fruits table by selecting the referenced values from Colors in a dropdown. Currently, the "Fruits" table has a dropdown for ColorID but no values are populating, thus I cannot create new entries in Fruits because ColorID cannot be null, and does not present the ability to select or enter a value.
Did you use the default inline editing page template? It should create the necessary code to populate the dropdowns in the Page load event. If you haven't you should data-bind the dropdowns (set their Data property).
I used the default inline editing page template. Did not automatically populate the drop downs, but was able to identify it as a foreign key. I can't seem to see where to databind the drop down portion. Where can I find this? Thank you for your help!