How To Move Selected ListItems to Up in ListBox

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

Call the metod from OnClick Up Button event;
Code ;

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

İlişkili Yazılar :

  1. How To Move Selected ListItems to Down 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. Tracking Outlook Messages
  6. Itemlar için Checkbox kullanımı
  7. Machinarium Hileleri
  8. MSTSCAX.DLL Nasıl Kullanılır?
  9. Biztalk Server 2010 – Beta
  10. .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.