prdeshpande
asked on
How to add label control or text control in Datatable?
Hi, I have created DataTable programmatically and added below columns:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- -------
DataColumn dtc = new DataColumn("Site Title", Type.GetType("System.Strin g"));
dt.Columns.Add(dtc);
dtc = new DataColumn("User Name", Type.GetType("System.Strin g"));
dt.Columns.Add(dtc);
dtc = new DataColumn("Read", Type.GetType("System.Strin g"));
dt.Columns.Add(dtc);
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
And created label:
-------------------------- ---------- ---------- ---------- ----
Label lbl = new Label();
lbl.BackColor = Color.Blue;
lbl.Text = “textbox1.text”;
-------------------------- ---------- ---------- ---------- -----
Now, how to add lable in DataTable so labale color and the text value of label should display.
Means, I want to add here:
dtr["Site Title"] = “label should come here with blue color”; //DataRow dtr;
Kindly help.
--------------------------
DataColumn dtc = new DataColumn("Site Title", Type.GetType("System.Strin
dt.Columns.Add(dtc);
dtc = new DataColumn("User Name", Type.GetType("System.Strin
dt.Columns.Add(dtc);
dtc = new DataColumn("Read", Type.GetType("System.Strin
dt.Columns.Add(dtc);
--------------------------
And created label:
--------------------------
Label lbl = new Label();
lbl.BackColor = Color.Blue;
lbl.Text = “textbox1.text”;
--------------------------
Now, how to add lable in DataTable so labale color and the text value of label should display.
Means, I want to add here:
dtr["Site Title"] = “label should come here with blue color”; //DataRow dtr;
Kindly help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What joshi is saying is correct. On HTML side perhaps this will help:
Open in new window
Asim