Completed
Last Updated: 07 Jan 2015 15:43 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 19 Dec 2014 11:14
Category:
Type: Bug Report
0
FIX. RadListView - When swapping items in the BindingList, the RadListView is not refreshed
To reproduce:

BindingList<Item> items = new BindingList<Item>();
public Form1()
{
    InitializeComponent();

       
    for (int i = 0; i < 30; i++)
    {
        items.Add(new Item(Guid.NewGuid().ToString(),
            "Item" + i,i % 2 == 0,DateTime.Now.AddDays(i)));
    }
    this.listBox1.DataSource = items;
    this.listBox1.DisplayMember = "Title";

       this.radListView1.DataSource = items;
    this.radListView1.DisplayMember = "Title";
}

  
public class Item
{
    public string UniqueId { get; set; }

    public string Title { get; set; }

    public bool IsActive { get; set; }

    public DateTime CreatedOn { get; set; }

    public Item(string uniqueId, string title, 
        bool isActive, DateTime createdOn)
    {
        this.UniqueId = uniqueId;
        this.Title = title;
        this.IsActive = isActive;
        this.CreatedOn = createdOn;
    }
}

private void radButton1_Click(object sender, EventArgs e)
{
     var temp = items[3];
    items[3] = items[4];        
    items[4] = temp;
}
Attached Files:
0 comments