So basically I have this app that I made for real estate transactions. Now on the layout design, I have two datagridview display outputs. The first or top one for all the transactions, and the second or bottom one for filtered or selected transactions based on checkbox items on listview. Each line of information on the grid is saved on a custom list and displayed on the the datagrid.
Now my problem is how do I immediately update the second datagridview containing the filtered list based on checking or unchecking the checkbox items on the listview.
For example, once I uncheck the 'Condo' item the original custom list will be filtered and updated immediately and be displayed on the second/bottom datagridview, where transactions with only housetype of type (the other three checked ones) displayed.
I managed to check all the checkeditems and displayed them on a messagebox for testing. I was thinking of doing what I want this way. But unfortunately, I'm stuck right now. :(
Here's what I did:
private void listViewHouseTypes_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (listViewHouseTypes.FocusedItem != null)
{
foreach (ListViewItem houseType in listViewHouseTypes.CheckedItems)
{
MessageBox.Show(houseType.Text); // displays other checked items on messagebox
}
}
}
Aucun commentaire:
Enregistrer un commentaire