protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lstDisplay.Items.Add("satya");
lstDisplay.Items.Add("rama");
lstDisplay.Items.Add("jaga");
lstDisplay.Items.Add("mohan");
lstDisplay.Items.Add("sasi");
}
}
protected void btnFOne_Click(object sender, EventArgs e)
{
ListItemCollection licCollection;
try
{
licCollection = new ListItemCollection();
for (int intCount = 0; intCount < lstDisplay.Items.Count; intCount++)
{
if (lstDisplay.Items[intCount].Selected == true)
licCollection.Add(lstDisplay.Items[intCount]);
}
for (int intCount = 0; intCount < licCollection.Count; intCount++)
{
lstDisplay.Items.Remove(licCollection[intCount]);
lstAdd.Items.Add(licCollection[intCount]);
}
}
catch (Exception expException)
{
Response.Write(expException.Message);
}
finally
{
licCollection = null;
}
}
protected void btnBOne_Click(object sender, EventArgs e)
{
ListItemCollection licCollection;
try
{
licCollection = new ListItemCollection();
for (int intCount = 0; intCount < lstAdd.Items.Count; intCount++)
{
if (lstAdd.Items[intCount].Selected == true)
licCollection.Add(lstAdd.Items[intCount]);
}
for (int intCount = 0; intCount < licCollection.Count; intCount++)
{
lstAdd.Items.Remove(licCollection[intCount]);
lstDisplay.Items.Add(licCollection[intCount]);
}
}
catch (Exception expException)
{
Response.Write(expException.Message);
}
finally
{
licCollection = null;
}
}
protected void btnBmultiple_Click(object sender, EventArgs e)
{
try
{
foreach (ListItem item in lstAdd.Items)
lstDisplay.Items.Add(item);
lstAdd.Items.Clear();
}
catch (Exception expException)
{
Response.Write(expException.Message);
}
}
protected void btnfmultiple_click(object sender, EventArgs e)
{
try
{
foreach (ListItem item in lstDisplay.Items)
lstAdd.Items.Add(item);
lstDisplay.Items.Clear();
}
catch (Exception expException)
{
Response.Write(expException.Message);
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment