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 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Joginder BangerRank #360 · 7K reputationPosted Dec 27, 2014, 10:06 PM EST
dt.clear(); // clear() is predefine function.