【发布时间】:2011-10-27 09:58:05
【问题描述】:
我正在尝试从数组列表中删除项目,但项目没有被删除,我没有收到任何错误删除不起作用。
protected void ibtnMoveUp_Click(object sender, ImageClickEventArgs e)
{
ArrayList ImgArry = new ArrayList();
ImgArry.Add(SelImgId);
ImgArry.Add(SelImgpath);//image name
ImgArry.Add(SelImgName);//image path
List<int> t1 = new List<int>();
if (Imgarry1 != null)
t1 = Imgarry1;//Imaarry1 is the type List<int>
t1.Add(Convert.ToInt32(ImgArry[0]));
Imgarry1 = t1;
List<ArrayList> t = new List<ArrayList>();
if (newpath.Count > 0)// newpath is the type List<ArrayList> nd creating the viewstate
t = newpath;
t.Remove(ImgArry);//Item is not getting remove
newpath = t;
for (int i = 0; i < newpath.Count; i++)
{
ArrayList alst = newpath[i];
newtb.Rows.Add(Convert.ToInt32(alst[0]), alst[1].ToString(), alst[2].ToString(), i);
}
dlstSelectedImages.DataSource = newtb;
DataBind();
}
【问题讨论】: