Browse by category:
|| | ||
How can I delete a row in a cell grid?
Say, for example, you have a 20x20 cell grid and you would like to remove the 12th row.
You don't delete a row, per se. Instead, you change the number of rows for your grid and then remove the row (however it is represented) from the underlying data model.
Let's assume you have 20 rows and you would like to remove the 12th row when a button is pressed. In the event handler for the button, you would change the number of rows for the grid to be 19. Then you would have to modify the data model to remove the 12th row.
Here is an example of the first part...
RowCollection rc = pCellGrid1.getRowCollection(); //this is where you change the number of rows
Then, depending on the collection type for the rows, you have to modify the data to remove that row.
For example, if the collection is an array, you move all the elements after the 12th location one spot over.
rem; //the row to be removed
for( i = rem; i <= row_; i++);
|Updating sliders after calling setCurrent()||How to create and run Stored Procedures in DB2|