ravi chaudhary

ravi chaudhary

  • NA
  • 14
  • 7.3k

Delete table At once

Dec 28 2014 2:43 AM
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");
}
}
 

Answers (1)