无法从webgrid获取下拉值 [英] Unable to get drop down value from webgrid

查看:98
本文介绍了无法从webgrid获取下拉值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格,我想添加一个下拉列,当我点击下拉网格中的任何位置时,它取第一行值而不是相应的行



它应该采取特定行值而不是第一行下拉值



我尝试过:



新的WebGridColumn {

ColumnName =IsActive,

Header =IsActive,
格式= @< text>





< select class =editid =txtStatusvalue =@ item.Isactive>

< option value =true> true< / option>

< option value =false> false< / option>

< / select>







var status = $(#txtStatus option:selected)。val();



获取下拉值

解决方案

(#txtStatus选项:已选择)。val();



获取下拉值

i have a web grid and i want to add a drop down column to that when ever i clicking on drop down any where in the web grid its taking the first row value not that respective row

it should take the particular row value not the first row drop down value

What I have tried:

new WebGridColumn{
ColumnName="IsActive",
Header="IsActive",
Format = @<text>


<select class="edit" id="txtStatus" value="@item.Isactive" >
<option value= "true" >true</option>
<option value= "false ">false</option>
</select>



var status = $("#txtStatus option:selected").val();

for getting the dropdown value

解决方案

("#txtStatus option:selected").val();

for getting the dropdown value


这篇关于无法从webgrid获取下拉值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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