Resizing in ASP.NET MVC DropDownList Control

14 Dec 20241 minute to read

You can dynamically adjust the size of the popup in the DropDownList component by using the AllowResize property. When enabled, users can resize the popup, improving visibility and control, with the resized dimensions being retained across sessions for a consistent user experience.

The following sample illustrates the implementation of the Popup Resize feature.

@Html.EJS().DropDownList("Status").Placeholder("Select Status").PopupHeight("200px").AllowResize(true).DataSource((IEnumerable<object>)ViewBag.data).Fields(new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings { Value = "Status"}).Render()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
    public class DropDownListController : Controller
    {
       public ActionResult Index()
        {
            ViewBag.data = new PopupResizeData().ResizeDataList();
            return View();
        }     
    }
}

Resizing in DropDownList Component