<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br><br>--- El <b>lun 1-ago-11, John Repucci <i><john.repucci@gmail.com></i></b> escribió:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: John Repucci <john.repucci@gmail.com><br>Asunto: Re: [Lazarus] Should StringGrid1.Clear clear the fixed rows / columns?<br>A: lazarus@lists.lazarus.freepascal.org<br>Fecha: lunes, 1 de agosto de 2011, 16:14<br><br><div><div class="yiv993516810gmail_quote"><blockquote class="yiv993516810gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;">
From: Jesus Reyes <<a rel="nofollow" ymailto="mailto:jesusrmx@yahoo.com.mx" target="_blank" href="/mc/compose?to=jesusrmx@yahoo.com.mx">jesusrmx@yahoo.com.mx</a>><br>
<br>
<br>
... Delphi grids do not implement a clear method :D so this is not a compatibility problem, or is it?.<br>
<br></blockquote><div>The add-on component VirtualStringView/Tree does implment a clear method that does not delete the headers.</div><div><br></div></div></div></blockquote><div id="yiv993516810"><div class="yiv993516810gmail_quote"><div>Lazarus grids never meant to be compatible with virtualstringview/tree.<br></div></div></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br><div><div class="yiv993516810gmail_quote"><div><br>I can envision cases where I would like a completely empty SG and cases where I would like the fixed rows / columns to survive.<br>
ex 1: Instead of creating a 2nd SG with a completely different header structure and purpose, wipe the original, add in the desired new fixed cells and start to fill it.</div><div><br></div></div></div></blockquote><div><div class="yiv993516810gmail_quote"><div>you can do this after grid.clear, or simply grid.rowcount := grid.fixedrows and then change the columns titles</div></div></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div><div class="yiv993516810gmail_quote"><div><br>ex: 2: (my current case...) Load in data, process it and then I need to purge the data, so I clear the SG and load in more data.</div><div><br></div></div></div></blockquote><div><div class="yiv993516810gmail_quote"><div>you can do this with grid.rowcount := grid.fixedrows (which is btw unsupported in delphi AFAIK), no need to use clear method</div></div></div><blockquote style="border-left: 2px solid rgb(16, 16, 255);
margin-left: 5px; padding-left: 5px;"><div><div class="yiv993516810gmail_quote"><div>
<br>John<br></div></div></div></blockquote><div><div class="yiv993516810gmail_quote"><div>Jesus Reyes A.</div><div><br></div></div></div></td></tr></table>