数据列表EditCommand自定义 [英] Datalist EditCommand Customization
问题描述
这是我的数据列表editcommand事件处理程序
Hi,
here''s my Datalist editcommand event handler
protected void DataList1_EditCommand(object source, DataListCommandEventArgs e)
{
DataList1.EditItemIndex = e.Item.ItemIndex;
DataBind();
}
现在,我需要做的是在Markup中,我的标签之一具有性别显示,该性别显示存储在客户信息"数据库表中,男性的整数值为0,女性的整数值为1.
当我单击编辑"按钮时,标签分别与男性的0或女性的1绑定在一起,但我需要用一个分别显示男性或女性的下拉菜单填充该标签,我该怎么做为此在我的EditCommand中?
谢谢,
Chetan.
Now what i need to do is one of my labels in Markup has gender display which is stored as an Integer value of 0 for a Male and 1 for Female in database table of customers Information.
when I click on Edit button, the label get binded with the respective value of 0 for male or 1 for female but instead of that i need to get that label filled with a dropdown showing a Male or Female respectively, what do I need to do for that in my EditCommand?
Thanks,
Chetan.
推荐答案
尝试按照以下方式从数据库中检索tht.
try to retrieve tht from DataBase in the Following Way.
select CandidateID,ContactNo,Email,case isfresher when 0 then ''Male'' when 1 then ''Female'' end as IsFresher from CandidateDetails
//Where IsFresher will be your Coloumn Name
这篇关于数据列表EditCommand自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!