下拉值无法在gridview中刷新 [英] dropdown value not refresh in gridview

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

问题描述


我在gridview中使用dropdownlist作为

 <   asp:DropDownList     ID   ="   ="span>   样式  =" 大纲:0"  runat   服务器"  SelectedValue   ='  <% #Eval (" )%>' > 
<   asp:ListItem    文本  ="     0 " <   asp:ListItem    文本  ="     1 " <   asp:ListItem    文本  ="     2 " 解决方案

Make AutoPostback属性= TRUE 提出建议. lang ="xml"> < asp:DropDownList < big > AutoPostBack ="true " < /big > ID ="drpstatus "Style =" outline:0"runat =" server"SelectedValue ='" 状态值")< asp:ListItem 文本 =" 0 " < asp:ListItem 文本 =" 1 " < asp:ListItem 文本 =" 2 " <asp:DropDownList ID="drpstatus" Style="outline: 0" runat="server" SelectedValue='<%#Eval("status_value")%>'> <asp:ListItem Text="Inactive" Value="0"> <asp:ListItem Text="Active" Value="1"> <asp:ListItem Text="Rejected" Value="2">


when i bind 1st time it show correct selected value but when i change the value through another webform and refresh this page the value still remains same and i checked in database it has changed but not it is not changing in dropdown

please suggest

解决方案

Make AutoPostback Property = TRUE of your dropDownList.


<asp:DropDownList <big>AutoPostBack="true"</big> ID="drpstatus" Style="outline: 0" runat="server" SelectedValue='<%#Eval("status_value")%>'>
<asp:ListItem Text="Inactive" Value="0">
<asp:ListItem Text="Active" Value="1">
<asp:ListItem Text="Rejected" Value="2">




try this,

All the best :-)


Hi can u post ur binding code?

u need to bind that grid view on page load without any condtion
or u need to refill ur dataset


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

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