private void AddTableRow(Table T, DataRow myDataRow, int NumeroRiga, int[] orderedcols, string PanelId) { if (T == null) { return; } if (myDataRow == null) { return; } DataTable TT = myDataRow.Table; //Nuova Riga TableRow TR1 = new TableRow(); //TR1.Height = 24; T.Rows.Add(TR1); if ((NumeroRiga & 1) == 0) { TR1.CssClass = "odd"; } TableCell T_Chk = new TableCell(); hwCheckBox HwC = new hwCheckBox(); HwC.ID = "Chk_Selector_" + PanelId + "_" + NumeroRiga; HwC.Tag = NumeroRiga.ToString(); T_Chk.Controls.Add(HwC); TR1.Cells.Add(T_Chk); for (int i = 0; i < orderedcols.Length; i++) { DataColumn C = TT.Columns[orderedcols[i]]; //Aggiungo tutte le celle. TableCell TC1 = new TableCell(); TC1.Text = GetValoreFormattato(myDataRow, C.ColumnName, HelpForm.GetFormatForColumn(C)); System.Windows.Forms.HorizontalAlignment HA = HelpForm.GetAlignForColumn(C); if (HA == System.Windows.Forms.HorizontalAlignment.Right) { TC1.HorizontalAlign = HorizontalAlign.Right; } else { TC1.HorizontalAlign = HorizontalAlign.Left; } TR1.Cells.Add(TC1); } }