Skip to content

A Multiple Selection DropDownList (a CheckBoxList )

Lalit k

Asked Jan 19, 2017, 7:06 PM EST1 answer
Share
LinkedInX
I need a code in C#
like i am having an gridview and above the gridview i am having a drop down for different column in the dropDown i can select all the values or multiple values so can u please advice me on this how can i achieve this .
or in Short i want for gridview
Code
A Multiple Selection DropDownList (a CheckBoxList Inside a DropDownList)
 
Based on the checkbox selection gridview data is populated . 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Here is your code dropdown in checkbox which give you a result in alert message.Hope this will work for you. 
     
    PowerShell
    String message = "";
    foreach (ListItem sp in listSports.Sports)
        {
            if (item.Selected)
            {
                message += sp .Text + " " + sp .Value + "\\n";
            }
        }
        ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true);
    }
    0