1

I need to have a list somewhat similar to CheckedListBox. The format would be

No.   Name                  Use?
1     First item            [ ]
2     Second item           [X]
3     Third item            [X]

The name should not be editable. The number should be editable and the order should update automatically. For example, if you would change the number of "Third item" in the above example to '1', it would become this:

No.   Name                  Use?
1     Third item            [X]
2     First item            [ ]
3     Second item           [X]

Also, dragging the order would be a nice feature. How do I accomplish a list like this?

2 Answers 2

1

DataGridView should solve this. You have to set its DataSource property to a collection of instances of a class similar to this:

public class Row
{
    public Row(string name) { Name = name; }
    public string Name { get; private set; }
    public int No { get; set; }
    public bool Use { get; set; }
}
0

Extend the CheckedListBox type.

Regarding drag and drop check this out

http://www.codeproject.com/Articles/4774/Windows-Forms-Custom-Controls-Part-1-Mastering-Dra

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.