アイテムをarraylistから削除しようとしていますが、アイテムが削除されていません。削除エラーが出ません。アイテムを削除できません。削除してください。
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();
}
を追加しましたが、昨日からの答えです:http://stackoverflow.com/questions/7907475/simplifying-locating-an-element-in-a-list-perhaps-using-linq/7907500 #7907500 –