Print Page | Close Window

Remove all rows

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=5277
Printed Date: 27 November 2024 at 7:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Remove all rows
Posted By: baerten
Subject: Remove all rows
Date 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



Replies:
Posted By: sserge
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net