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. Machinarium Hileleri
  5. Google Translate Kullanarak .NeT de Dil Çevrimi
  6. Tracking Outlook Messages
  7. Itemlar için Checkbox kullanımı
  8. DropDownList’de RequiredFieldValidator Kullanımı
  9. Mühendislik Yönetimi – Pazarlama Yönetimi Sunumları
  10. .NeT Full Screen

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

Önceki Yazı << Sonraki Yazı >>

Leave a Reply