Delete Table at once in which we are present
Function for that is given below ..../(We are making a html Editor in web form)
public void DeleteTable()
{
mshtmlTable table1 = null;
mshtmlTableRow rows = null;
GetTableElement (out table1,out rows);
if(table1!=null )
try
{
// table1.rows.
// int index = table1.rows.length;
//// for (int idxcol = 0; idxcol < index; idxcol++)
foreach (mshtmlTable row in table1.rows)
{
row.deleteRow();
}
}
catch (Exception ex)
{
throw new HtmlEditorException("Unable to delete a table", "tabledelete", ex);
}
else
{
throw new HtmlEditorException("Table not currently selected ", "tabledelete");
}
}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Joginder BangerPosted Dec 28, 2014, 3:06 AM
dt.clear(); // clear() is predefine function.