I want to select the index id of datalist my code is
protected void dlst1_SelectedIndexChanged1(object sender, EventArgs e)
{
indexId = Convert.ToInt32(dlst1.DataKeys[dlst1.SelectedIndex]);
}
and i am moving the item from left to right based on the selected item index, but i am getting the indexId 0 and its is getting swap reverse, it should move left to right but its moving right to left
protected void btnMoveright_Click(object sender, ImageClickEventArgs e)
{
List<ArrayList> temp = 1path;
ArrayList temp2 = temp[indexId];
temp[indexId] = temp[indexId + 1];
temp[indexId + 1] = temp2;
for (int i = 0; i < temp.Count; i++)
{
ArrayList lst = temp[i];
tb.Rows.Add(Convert.ToInt32(lst[0]), lst[1].ToString(), lst[2].ToString(), i);
}
dlst1.DataSource = tb;
DataBind();
path = BaseDAL.GetImg(Ids);
for (int i = 0; i < path.Count; i++)
{
ArrayList lst = path[i];
tb.Rows.Add(Convert.ToInt32(lst[0]), lst[1].ToString(), lst[2].ToString(), i);
}
dlst2.DataSource = tb;
DataBind();
}
Please someone help me in this, how to move the item
i have added only