Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Remove all rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Remove all rows

 Post Reply Post Reply
Author
Message
baerten View Drop Down
Newbie
Newbie
Avatar

Joined: 28 September 2006
Location: Germany
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote baerten Quote  Post ReplyReply Direct Link To This Post Topic: Remove all rows
    Posted: 12 October 2006 at 4:51am
 Hi everybody
 
  //Grid.GetRows()->Clear();
  Grid.GetRecords()->RemoveAll();

  for(int i=0; i<CustomerList->Count; i++) {
    Grid.AddRecord(CustomerList->InternalList);
  }
 
  Grid.RedrawControl();
  Grid.Populate();

I like to remove all rows of the Grid before inserting new ones.

At the beginning, when the grid is clear, all works
If the grid has already rows, so it removes all rows & records ( verified with GetCount )

But at Grid.Populate(); it has an error

Thanks
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2006 at 7:59am
Hi,

In your code, try calling Populate twice:

Grid.GetRecords()->RemoveAll();
Grid.Populate();

for(int i=0; i<CustomerList->Count; i++) {
  Grid.AddRecord(CustomerList->InternalList);
}
 
Grid.Populate();


--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.