G
Guest
I'm trying to add a custom property to each row of a table. So I created an HtmlTable called tblClass, I created a new class myRow inherited from HtmlTableRow, to which I added a new member myRow
public class myRow : System.Web.UI.HtmlControls.HtmlTableRow
private string _myCustomProp
public myRow() : base()
_myCustomProp=""
public string myCustomProp
get {return _myCustomProp;
set {_myCustomProp = value;
Then in my page class I have
private void Page_Load(object sender, System.EventArgs e
myRow myTR = new myRow()
myTR.BgColor = "#b0c4ae"
myTR.myCustomProp = "A123456"
...
tblClass.Rows.Add(myRow)
....
The problem is that the <TR>'s of the resulting table don't have my custom property myCustomProp. They do have the BgColor though
What am I doing wrong in trying to add this custom property to the <TR>
Thank you.
public class myRow : System.Web.UI.HtmlControls.HtmlTableRow
private string _myCustomProp
public myRow() : base()
_myCustomProp=""
public string myCustomProp
get {return _myCustomProp;
set {_myCustomProp = value;
Then in my page class I have
private void Page_Load(object sender, System.EventArgs e
myRow myTR = new myRow()
myTR.BgColor = "#b0c4ae"
myTR.myCustomProp = "A123456"
...
tblClass.Rows.Add(myRow)
....
The problem is that the <TR>'s of the resulting table don't have my custom property myCustomProp. They do have the BgColor though
What am I doing wrong in trying to add this custom property to the <TR>
Thank you.