In the past i was using this
DateBookingTable.Rows.Clear();
To remove all the rows.
Now I want to remove all the rows except the first one.
because when I remove all the rows, the th
is removed, i don't want that. i want to remove all the data. not the th
this is what i don't want to remove
<tr><th>ID</th><th>PlanTime</th></tr>
I make this loop:
for (int i = 0; i < DateBookingTable.Rows.Count; i++) {
if (i >0){
//here what should I do
}
}
but I didn't know how to remove that row in the looop
while (MyTable.Rows.Count > 1) MyTable.Rows.RemoveAt(1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With