anuruddha pandey

anuruddha pandey

  • NA
  • 22
  • 8.3k

html editor using mshtml

May 3 2015 7:51 AM
how to multiple table column width  in dynamic  created numeric updown control 





                for (int i = 0; i < txtno; i++)
                {

                    Label b = new Label();
                    b.Text = ("Col" + (i + 1)).ToString();
                    b.Location = new Point(pointX, pointY);
                    b.Width = 34;
                    // b.Width = 35;
                    b.Height = 20;
                    columnwid.flowLayoutPanel1.Controls.Add(b);
                    columnwid.flowLayoutPanel1.Show();
                    pointX += 36;
               // }
                        //TextBox a = new TextBox();
                        //HtmlElement row2 = table.GetElementsByTagName("tr")[0];
                        //foreach (HtmlElement cell2 in row2.GetElementsByTagName("td"))
                        //{ 
                        NumericUpDown a = new NumericUpDown();

                        //a.Value=(Math.Round(System.Convert.ToDecimal(elementCell.style.width)));
                        a.Location = new Point(pointX, pointY);
                        columnwid.flowLayoutPanel1.Controls.Add(a);
                        columnwid.flowLayoutPanel1.Show();
                        a.Width = 45;
                        //a.Width = 35;
                        a.Height = 20;
                        pointX += 36;
                        columnwid.radioWidthPixel.Checked = true;
                       
                        //int width = Convert.ToInt32(cellSelect.style.width);
                        object width = cellSelect.style.width;
                           // string width = cell2.GetAttribute("width").ToString();
                        //if (width == null)
                        //{
                        //    width = cellSelect.width;
                        //    // width = Convert.ToInt32(cellSelect.width);
                        //}
                        

                        if (width != null)
                        {

                            value = decimal.Parse(width.ToString().Replace("%", string.Empty).Replace("px", string.Empty).Replace("pt", string.Empty));
                            if (value > 0)
                            {
                                a.Value = value;
                                j = a.Value;

                                // columnwid.radioWidthPixel.Checked = true;
                            }
                        }


Answers (1)