在我的asp.net应用程序中,我在dropdownlist中遇到问题 [英] In my asp.net application i hava a problem in dropdownlist
问题描述
在我的asp.net应用程序中,我在dropdownlist中遇到问题
我想在编辑时更改下拉列表的选定值
我的代码是
DataSet _DsDetail = new DataSet();
_DsDetail = objTranDetail.GetLedgerTransactionDetail(_LedgerTransID);
_AccountLedgerID = Convert.ToInt32(_DsDetail.Tables [0] .Rows [0] ["RelatedAccountLedgerID"].ToString());
ddlDebitAccount.SelectedValue = _AccountLedgerID.ToString();
在此_AccountLedgerID获取校正后的值,但在
ddlDebitAccount.SelectedValue = _AccountLedgerID.ToString();
selectedvalue不变,包含旧值
例如:
如果_AccountLedgerID为8,则ddlDebitAccount.SelectedValue不会为8
请帮助我.....................................
In my asp.net application i hava a problem in dropdownlist
I want to change selected value of dropdown list at the time of editing
my code is
DataSet _DsDetail = new DataSet();
_DsDetail = objTranDetail.GetLedgerTransactionDetail(_LedgerTransID);
_AccountLedgerID = Convert.ToInt32(_DsDetail.Tables[0].Rows[0]["RelatedAccountLedgerID"].ToString());
ddlDebitAccount.SelectedValue = _AccountLedgerID.ToString();
here _AccountLedgerIDget currecteed value but in
ddlDebitAccount.SelectedValue = _AccountLedgerID.ToString();
selectedvalue is not change it contain older value
ex:
if _AccountLedgerID is 8 then ddlDebitAccount.SelectedValue not get 8
pls help me............................
推荐答案
重新绑定更改项目列表详细信息后的下拉列表.
Rebind the dropdownlist after changed the item list details.
这篇关于在我的asp.net应用程序中,我在dropdownlist中遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!