File:Drop-down list example.PNG
Summary
| Description |
English: An example of a drop-down list(computing GUI widget). This is not a screenshot of a real program - I just drew it, and it's meant to look simple and generic. Deutsch: Ein Beispiel für eine Drop-Down-Liste einer grafischen Softwarebedienoberfläche). Dies ist kein Screenshot aus einem echten Programm. Es ist lediglich selbst angelegt, um als einfaches und allgemeines Beispiel zu taugen. |
| Source | Own work |
| Author | Jaksmata |
===================================================
Dropdownlist Example
public void GetId()
{
Ds = obj.fillDataSet("usp_getDataId", "tbl_DataId");
DdlDataId.Items.Clear();
DdlDataId.Items.Add(new ListItem("-Select-", "-1"));
DdlDataId.DataSource = Ds.Tables["tbl_DataId"];
DdlDataId.DataTextField = "fld_Id";
DdlDataId.DataValueField = "fld_Id";
DdlDataId.DataBind();
}
public void GetMonth()
{
DDLMonth.Items.Clear();
DDLMonth .Items .Add (new ListItem ("-Select-","-1"));
for (int i = 1; i <= 12; i++)
{
DDLMonth.Items.Add("" + i.ToString());
}
}
public void GetYear()
{
DDLYear.Items.Clear();
DDLYear.Items.Add(new ListItem("-Select-", "-1"));
for (int j = 2000; j <= 2099; j++)
{
DDLYear.Items.Add("" + j.ToString());
}
===================
<asp:DropDownList ID="DDLYear" runat="server" Width="140px"
AutoPostBack ="false" AppendDataBoundItems ="true" > <%--<asp:ListItem Selected ="True">-Select-</asp:ListItem>--%>
</asp:DropDownList> <asp:RequiredFieldValidator ID="Req1" runat="server" ErrorMessage="Please Select" ControlToValidate ="DDLYear" Display ="None" ></asp:RequiredFieldValidator> <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" TargetControlID ="Req1" PopupPosition ="Left"> </cc1:ValidatorCalloutExtender>
====================
Licensing
| I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |