Hi,
I want an element "check all" inside the dropdownlist items.
I've done this:
<ej:DropDownList ID="ddlGrupoOS" runat="server" SelectMethod="GetGruposOS" DataTextField="Nombre" DataValueField="ID" OnDataBinding="ddlEstadoOS_DataBinding" ></ej:DropDownList>
.....
<script>
function onCheckUncheckAll(args) {
if (args.value == "0") {
var sender = $('#<%=ddlGrupoOS.ClientID%>').data("ejDropDownList");
if (args.isChecked)
sender.checkAll();
else
sender.unCheckAll();
}
}
<script>
Code Behind
public IEnumerable<GrupoOS> GetGruposOS()
{
DMOperaciones db = new DMOperaciones();
var result = db.GetGruposOS().OrderBy(x => x.ID).ToList();;
result.Insert(0, new GrupoOS() { ID = 0, Nombre = "Check all" });
return result;
}
I need this "property" in a lot of dropdown list. I think that it could be better done, but I don't know
Thanks