1
我已经写了这么多...但是我如何将encryptedstatusid分配给listDTO以用于数据绑定?在数据绑定gridview中使用foreach修改列中的值
protected void Page_Load(object sender, EventArgs e)
{
List<DTO> listDto;
IApplication engine;
try
{
engine = new Engine();
listDto = engine.ReadHistory(Session["UserID"].ToString());
foreach (DTO iterDTO in listDto)
{
iterDTO.EncryptedStatusId = Triple.Encrypt(iterDTO.StatusId.ToString());
//how i assign the encryptedstatusid to the listDTO for databind?????????????
}
this.dvHistory.DataSource = listDto;
this.dvHistory.DataBind();
}
catch (Exception)
{
throw ;
}
finally
{
engine = null;
}
}
问题是即时得到的encryttedstatusid到iterDTO,但satasource是一个名单,我想encry PTED状态ID分配给listDto,那么只有它会在网格显示
什么是与此代码的问题? GridView中的EncryptedStatusId列数据绑定? – 2011-06-13 09:48:20
u cud保留一个计数器并做listDTO [counter] = statusID,忘记不要增加计数器;) – Zenwalker 2011-06-13 09:54:27