How To Move Selected ListItems to Down in ListBox

Çarşamba, Ocak 14th, 2009 @ 18:54

Call the metod from OnClick Down Button event;
Code ;

public void MoveDown()
    {
        int startindex = ListBox2.Items.Count - 1;
        for (int i = startindex; i > -1; i--)
        {
            if (ListBox2.Items[i].Selected)
            {
                if (i < startindex && !ListBox2.Items[i + 1].Selected)
                {
                    ListItem bottom = ListBox2.Items[i];
                    ListBox2.Items.Remove(bottom);
                    ListBox2.Items.Insert(i + 1, bottom);
                    ListBox2.Items[i + 1].Selected = true;
                }

            }
        }
    }

İlişkili Yazılar :

  1. How To Move Selected ListItems to Up in ListBox
  2. Listview’da Selected index
  3. Bir SPList’in Tüm Item’larını Silmek
  4. Google Translate Kullanarak .NeT de Dil Çevrimi
  5. MSTSCAX.DLL Nasıl Kullanılır?
  6. Biztalk Server 2010 – Beta
  7. .NeT Full Screen

Tags: , ,
Posted in .NeT 2008 | No Comments »

Önceki Yazı << Sonraki Yazı >>

Leave a Reply



Yeni yorumları e-posta aracılığıyla bana bildir. Ayrıca yorum yapmadan da abone olabilirsiniz.