On save handling of dropdown multi-select

hi guys,

i have a fairly simple question, i can't seem to wrap my head around.

on a [ADD] scheduling page, i set some paramaters and then allocate a number of users to the schedule.
to do this i'm using a dropdown list for users with a multi-select enabled.

the action is really easy;

  1. create a new record object and esatblish the unique ID as a part of page load
  2. save the new record on form submit
  3. call a function to save the users and link them using the associated schedule ID

the question is, how do i access the IEnumerable from the dropdown list in the page partial class?

what im thinking is that i include a 'onChange' event for the dropdown list to maintain the recorded values in a list declared in the partial class.
then after save, i could call a function to write the list to the database linking the list to the newly created schedule record.

but again, i'm not sure on the best pattern here

In the page partial class you can access everything that is available in page - that's what partial classes are for.

hi @enchev i must be missing something simple here,
this is the item name in radzen studio

notice in the partial class that i can't use it / locate it

This is just the name of the form component it's not related to data nor selection.

yeah okay so the data for this component comes from getAspNetUsersResult

how do i access the selected values from the component?

sorry for the seemingly simple question, i'm sure it's easy when you have done it thousands of times

selected values are the variable bound to Value of the component.

yes hence my question, how do i access the component "assuranceScheduleUsersDDL' in the partial class?

i would have thought a code line like
var xyz = assuranceScheduleUsersDDL.Value;

would make xyz an IEnumerable with the values from the dropdown list.

however i can't seem to get any reference to assuranceScheduleUsersDDL in the partial class to work

it must be soo obvious that i can't see it :smiley:

You should read carefully my previous reply. You should bind a page property to the DropDown Value and access the property.