How can I update a CListCtrl automaticaly when using a dynaset database.
Printable View
How can I update a CListCtrl automaticaly when using a dynaset database.
in OnUpdate of the view I use this code to force a refresh of the CListCtrl
LV_ITEM lvi;
memset(&lvi, 0, sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.pszText = LPSTR_TEXTCALLBACK;
lvi.iSubItem = 0;
for (i=0; i < NumOfData; i++)
{
lvi.iItem = i;
lvi.lParam = i;
m_List.InsertItem(&lvi);
}
}
IF the number of rows did not change then it is only a matter of invalidateing what needs to be updated.
Do the following to only redraw the rect of the row that needs to be
m_List.GetItemRect(row, &rect, LVIR_BOUNDS);
InvalidateRect(&Rect);