jeudi 5 mars 2020

ObjectlistView Checkbox Issue

i have an issue trying to get an Checkbox working with ObjectListview.

My model looks like this:

public class object
{   
public string name {get; set;}
public int age {get; set;}
public bool inuse {get; set;}
}

and i added a FastObjectListView via the Designer in Visual Studio to a Win Forms Application. Then, i added the Columns and set the AspectName for each column to the Models Property (First column: AspectName: name, Second Column: AspectName: age, Third Column: AspectName: inuse).

Afterwards, i filled the ListView with this:

using (var context = new objectDb())
            {
                var objectlist = context.objects.ToList();
                fastoLV_Clean.SetObjects(objectlist);                             
                fastoLV_Clean.Refresh();
            }       

what works and i can see my Database entrys in the ListView.

Now i want to add a CheckBox column where someone can check or uncheck the items to delete them and i do not get the checkbox to work. I added a Column and set CheckBox to true, cHanged the CheckedAspectName of the ListView and now i can see the Checkboxes but nothing happens if i click them to check. I think i am on the completely wrong way, what do i have to do to make it work?

Thank you very much!!




Aucun commentaire:

Enregistrer un commentaire