473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

in TablePanelLayout ,when I removed a row, the space occupied doesn't get freed .

15
Here is my code
Expand|Select|Wrap|Line Numbers
  1.  public void DeleteItemRow(int currentRow)
  2.         {
  3.             tblOrderItemDetails.RowStyles.RemoveAt(currentRow);
  4.  
  5.             for (int columnIndex = 0; columnIndex < tblOrderItemDetails.ColumnCount; columnIndex++)
  6.             {
  7.                 var control = tblOrderItemDetails.GetControlFromPosition(columnIndex, currentRow);
  8.                 tblOrderItemDetails.Controls.Remove(control);
  9.             }
  10.  
  11.             for (int i = currentRow + 1; i < tblOrderItemDetails.RowCount; i++)
  12.             {
  13.                 for (int columnIndex = 0; columnIndex < tblOrderItemDetails.ColumnCount; columnIndex++)
  14.                 {
  15.                     var control = tblOrderItemDetails.GetControlFromPosition(columnIndex, i);
  16.                     if (control != null)
  17.                         tblOrderItemDetails.SetRow(control, i - 1);
  18.                 }
  19.             }
  20.             rowCount--;
  21.             tblOrderItemDetails.RowCount--;
  22.  
  23.         }
When I executed this code,it deleted the row (for the user). but internally it didn't. bcoz when I add another row , it gets added to the next row as if the deleted row still exists.

Could someone please answer how to get rid of this ?
May 5 '12 #1
0 1237

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Peter Abel | last post by:
I have an application, which is an instance of a class with a deeply nested object hierarchy. Among others one method will be executed as a thread, which can be stopped. Everything works fine...
0
by: Fred | last post by:
Hello, I found a CLOB column in a DMS table that programmers were using to store tiny strings (less than a couple kilobytes). Since CLOB columns can only allocate entire kilobytes of space at...
1
by: Riley DeWiley | last post by:
There is a way to ask a data source how much space would be freed if compaction were to be done. I saw the reference, but now cannot find it. Anyone know where that web page was? Even Google has...
30
by: jimjim | last post by:
Hello, This is a simple question for you all, I guess . int main(){ double *g= new double; *g = 9; delete g; cout<< sizeof(g)<<" "<<sizeof(double)<<" "<<sizeof(*g)<<" "<<*g<<" "<<endl; *g =...
9
by: zerro | last post by:
Hello, I try to understand heap overflows (under Linux), but can not understand one thing with freeing memory allocated with malloc(). Here it comes: I have a program called 1.c: main() {...
73
by: David Scarlett | last post by:
Is the following code safe? SomeType *a, *b; /* Some code.... */ free(a);
72
by: ravi | last post by:
I have a situation where i want to free the memory pointed by a pointer, only if it is not freed already. Is there a way to know whether the memory is freed or not?
5
by: Thor W Hammer | last post by:
Hello all, Is it possible to find out if a script is freed? This is actual when having a pointer to a function and should determine if it is freed so we don't call it and get error.. TWH
9
by: Simon | last post by:
Hi, I have written an ActiveX object to resize images and upload them to a database, this all works fine but when I close internet explorer the process iexporer.exe is still running in my task...
31
by: banansol | last post by:
Hi, I just want to get this right. A call to realloc() will return NULL on error and the original memory is left untouched, both when requesting a larger or a smaller size that the original,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.