带有ASP.NET下拉列表的Gridview [英] Gridview with dropdown in ASP.NET

查看:74
本文介绍了带有ASP.NET下拉列表的Gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个C#

的代码,就像我有一个gridview并且在gridview上面我在dropDown中有一个下拉列表中的不同列我可以选择所有值或多个值所以可以你能告诉我如何实现这个目标。



或简称我想要gridview



多选DropDownList(DropDownList内的CheckBoxList)





我尝试过:



i有gridview的代码,但需要多次选择

解决方案

列表盒子

====================

< asp:ListBox runat =serverID = ddlCarrierClientIDMode =StaticSelectionMode =Multiple

Height =115class =multiTabIndex =2>



对于Listbox使用ajax绑定

=========================

函数bindInitialDropdownList(){

.ajax({

类型:POST,

contentType:application / json; charset = utf-8,

url:Pagename / BindCarrier(方法名称),

dataType:json,

异步:false,

成功:函数(数据){



var ddlData ='';

var i = 0;


.each(data.d,function(key,value){

ddlData + =+ value + ;

i ++;

});


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

解决方案

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() {


.ajax({
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 + "";
i++;
});


这篇关于带有ASP.NET下拉列表的Gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆