Aisha Srivastava

Aisha Srivastava

  • NA
  • 230
  • 16.4k

Remove border of specific selectedcell in Htmltable wnform

Jan 10 2015 2:16 AM
 Remove border of selected cell in htmltable in windows form....





public void stylecell()
        {
            mshtmlTable table1 = null;
            mshtmlTableRow row1 = null;
            mshtmlTableCell cell1 = null;
            GetTableElement(out table1, out row1, out cell1);

            HtmlElement table = getTableHTMLElement();
            try
            {
                if (table != null)
                {

                    HtmlElement selectedCell = table.GetElementsByTagName("tr")[row1.rowIndex].GetElementsByTagName("td")[cell1.cellIndex];

                    {

  selectedCell.Style = "border-right:Red ";//border-top:Red;border-left:Red;"; //border-bottom: none";
                    }
                }

                else
                {
                    throw new HtmlEditorException("Cell not selected", "underlineComand");
                }
            }
            catch (Exception ex)
            {
                // process the standard exception
                OnHtmlException(new HtmlExceptionEventArgs(null, ex));
            }
        }

Answers (5)