List Control updates
-
Hai, Greetings of the day!. My doubt is how to update the data's present in the Listcontrol. I am having a List control in VC++ dialog based application, populated with some datas. As soon as i get a new data, the old data has to be updated with new one. Is there any way to solve to my problem. Please help with giving a sample program. Regards Jagan
-
Hai, Greetings of the day!. My doubt is how to update the data's present in the Listcontrol. I am having a List control in VC++ dialog based application, populated with some datas. As soon as i get a new data, the old data has to be updated with new one. Is there any way to solve to my problem. Please help with giving a sample program. Regards Jagan
Look at
CListCtrl::Update
andCListCtrl::RedrawItems
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
Look at
CListCtrl::Update
andCListCtrl::RedrawItems
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
Thanks Brahmma. I will try with your suggession and let you know. Regards Jagan
-
Hai, Greetings of the day!. My doubt is how to update the data's present in the Listcontrol. I am having a List control in VC++ dialog based application, populated with some datas. As soon as i get a new data, the old data has to be updated with new one. Is there any way to solve to my problem. Please help with giving a sample program. Regards Jagan
First use CListCtrl::DeleteAllItems() then use for(i=0; i < n; i++) CListCtrl::InsertItem(i, 0);//row, column then use for(i=0; i < n; i++) CListCtrl::SetItemText(i, 0, _T("hallo"));//row, column, value string
-
First use CListCtrl::DeleteAllItems() then use for(i=0; i < n; i++) CListCtrl::InsertItem(i, 0);//row, column then use for(i=0; i < n; i++) CListCtrl::SetItemText(i, 0, _T("hallo"));//row, column, value string
Ranjoy Guha wrote:
First use CListCtrl::DeleteAllItems()
You don't need to delete all items and redraw everything again. This is the worst way of doing it.
CListCtrl::InsertItem
is enough to insert new items.
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
Ranjoy Guha wrote:
First use CListCtrl::DeleteAllItems()
You don't need to delete all items and redraw everything again. This is the worst way of doing it.
CListCtrl::InsertItem
is enough to insert new items.
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
Suppose previously there was 15 items later there is 10 items then the previous 5 will stay
-
Suppose previously there was 15 items later there is 10 items then the previous 5 will stay
Ranjoy Guha wrote:
Suppose previously there was 15 items later there is 10 items then the previous 5 will stay
I don't understand what you tell. It is simple logic, you don't need to delete everything to add something new and display it.
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
Ranjoy Guha wrote:
Suppose previously there was 15 items later there is 10 items then the previous 5 will stay
I don't understand what you tell. It is simple logic, you don't need to delete everything to add something new and display it.
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
Suppose There are different Criteria 1. Student: having Properties (Name, Class, Roll, Age) 2 Teacher: having Properties (Name, Degree, Designation) And u need to update them depending on the selected Criteria(Student/Teacher) Now if you dont perform DeleteAllItems then the List Control will keep on growing with each selection. Isn't It ?
-
Suppose There are different Criteria 1. Student: having Properties (Name, Class, Roll, Age) 2 Teacher: having Properties (Name, Degree, Designation) And u need to update them depending on the selected Criteria(Student/Teacher) Now if you dont perform DeleteAllItems then the List Control will keep on growing with each selection. Isn't It ?
-
Suppose previously there was 15 items later there is 10 items then the previous 5 will stay
Ranjoy Guha wrote:
then the previous 5 will stay
This is why
DeleteAllItems()
should be used. It's the twofor
loops that you had that were in question. The second one was unnecessary.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb