• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delete table values without table header row

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am printing table programatically.In my xml file there is a table layout with header.I added data programatically.After adding data to the table i need to delete only data.How to do this?I used removeAllViews() method.But it removes all data in the table.below is the my xml file



 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone help me?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Draw the table structure out on paper. This should help you figure out what elements are involved in the Table. Then look at the API for TableLayout and see what methods are available for manipulating that structure. Obviously, removeAllViews() removes all views, and since you don't want to remove all views (you want to keep the header TableRow) then this is the wrong approach. But there are other methods TableLayout has that you can use to be more precise in what you remove.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve.I found the method.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic