ravi chaudhary

ravi chaudhary

  • NA
  • 14
  • 7.3k

Html editor (Table Section )-

Dec 22 2014 10:50 AM
Getting an error of exception row not selected and hence could not perform insert column operation
 
please could any one check the code and correct it...it is attached below 
 
 
 
public void tableinsertcol()
{
// see if a table selected or insertion point inside a table
mshtmlTable table = null;
IHTMLTableRow row = null;
mshtmlTableCell cell = null;
GetTableElement(out table, out row);
// process according to table being defined
if (table != null && row != null)
{
try
{
// find the existing row the user is on and perform the insertion
int index = cell.cellIndex;
foreach (mshtml.IHTMLTableRow rows in table.rows)
{
row.insertCell(index);
}
}
catch (Exception ex)
{
throw new HtmlEditorException("Unable to insert a new Row", "TableinsertRow", ex);
}
}
else
{
throw new HtmlEditorException("Row not currently selected within the table", "TableInsertRow");
}
}
 

Answers (1)