Hi Markus,
Thank you for contacting Syncfusion Support.
We have prepared a sample similar to your scenario with two DropDownList For sharing the same dataSource. When I select an item only the corresponding DropDownList is updated. If you wish to check the get the id of DropDownList from where selection is made you can get the id through select event as shown below.
|
<div class="row">
@using (Ajax.BeginForm("Get", "Home", new AjaxOptions { HttpMethod = "POST"}))
{
@Html.EJ().DropDownListFor(model => model.select).Datasource((IEnumerable<CustomerList>)ViewBag.customerListDataSource).DropDownListFields(f => f.Text("Name").Value("value").ID("Id")).WatermarkText("Select").Width("400").ClientSideEvents(e => e.Select("onSelect")).ShowRoundedCorner(true).EnableAnimation(true)
<br>
@Html.EJ().DropDownListFor(model => model.select2).Datasource((IEnumerable<CustomerList>)ViewBag.customerListDataSource).DropDownListFields(f => f.Text("Name").Value("value").ID("Id")).WatermarkText("Select").Width("400").ClientSideEvents(e => e.Select("onSelect")).ShowRoundedCorner(true).EnableAnimation(true)
<input type="submit" value="Get" />
}
</div>
<script>
function onSelect(args)
{
if (this._id == "select") {
console.log("Selection in first dropdownlist");
}
}
</script> |
After selecting the items in firs DropDownList, we get the corresponding selected values in id during form submit whereas the selected value of second dropdown is empty. Refer to the below screenshots.
We have attached a sample based on this. Please download the sample from:
If we have misunderstood, kindly modify the above sample to reproduce the issue along with product version details and replication procedure so that we can proceed further.
Regards,
Keerthana.