Click here to Skip to main content
14,383,148 members
Rate this:
Please Sign up or sign in to vote.
See more:
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

A Multiple Selection DropDownList (a CheckBoxList Inside a DropDownList)

What I have tried:

i have code for gridview but multiple selection i need it
Updated 20-Jan-17 19:44pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi, For List Box
<asp:ListBox runat="server" ID="ddlCarrier" ClientIDMode="Static" SelectionMode="Multiple"
Height="115" class="multi" TabIndex="2">

For Listbox Bind Using ajax
function bindInitialDropdownList() {
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Pagename/BindCarrier(method name)",
dataType: "json",
async: false,
success: function (data) {

var ddlData = '';
var i = 0;
$.each(data.d, function (key, value) {
ddlData += "" + value + "";

if ($('#ClientContentPlaceHolder_hdnCarrierIds').val() != "" && $('#ClientContentPlaceHolder_hdnCarrierIds').val() != "-1")
($('#ClientContentPlaceHolder_hdnCarrierIds').val()), "csv");

error: function (xmlHttpRequest, textStatus, errorThrown) {


Apply Web service call to bind MultiSelect DropDown

[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static Dictionary<string, string> BindCarrier()
//return Carrier Name ,and ID

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100