protected void GrvUploads_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.ToString() == "DeleNow")
{
List
if (oUploader != null)
{
oUploader.Remove(oUploader.Find(delegate(UploadEntity oEntity)
{
return (oEntity.UploadID == Convert.ToInt64(e.CommandArgument));
}
));
}
Session["UploadedFiles"] = oUploader;
BindUploadGrid();
}
}
1 comment:
You can also use Lambda expression in 3.0 and upper version.
Int64 intUploadId = Convert.ToInt64(e.CommandArgument);
oUploader.Remove(oUploader.Find(o => o.UploadId == intUploadId));
Worth reading the following article,
.Net Collection Management in C#
Post a Comment