Here is my mode.I am adding usercontrol to asp:table tag dynamically.AI want to add br tag after each user controlhas been added to the table.User controls arr added to the table acccording to rows in databse table.How can i add break tag to table dynamically.I want space in between controls in table.Could you please suggest me on this.
if (!Page.IsPostBack)
{
string mySql = "select * from Questions";
DataView dv = new DbCon().GetDataView(mySql)
;
DataRowView drv;
for (int i = 0; i < dv.Count; i++)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
drv = dv[i];
DotNetGraph graph = (DotNetGraph)Page.LoadCont
rol("~/Dot
NetGraph.a
scx");
//uc1 = (Control)tabel1.FindContro
l("dngchar
t" + i);
//lbl.Text = Convert.ToString(drv["Item
Descriptio
n"]);
graph.UserWidth = 200;
int agreeStrongly = Convert.ToInt32(drv["Agree
Strongly"]
);
int agree = Convert.ToInt32(drv["Agree
"]);
int neitherAgreeOrDisagree = Convert.ToInt32(drv["Neith
erAgree or Disagree"]);
int disagree = Convert.ToInt32(drv["Disag
ree"]);
String[] sItems = new String[4];
Int32[] iValue = new Int32[4];
// Populate our variables
sItems[0] = "Agree Strongely";
iValue[0] = agreeStrongly;
sItems[1] = "Agree";
iValue[1] = agree;
sItems[2] = "Neither Agree or Disagree";
iValue[2] = neitherAgreeOrDisagree;
sItems[3] = "Disagree";
iValue[3] = disagree;
// Set our axis values
graph.YAxisValues = iValue;
// Set our axis strings
graph.YAxisItems = sItems;
// Provide a title
string description = Convert.ToString(drv["Desc
ription"])
;
graph.ChartTitle = "<b>" + "<font size=4 color=purple>" + description + "</font>" + "</b>";
// Provide an title for the X-Axis
graph.XAxisTitle = "(units display actual numbers)";
cell.Controls.Add(graph);
row.Controls.Add(cell);
AuditTable.Controls.Add(ro
w);
Control c1 ="<br/>";
TableRow row1 = new TableRow();
TableCell cell1 = new TableCell();
cell1.Controls.Add(c1);
row1.Controls.Add(cell1);
AuditTable.Controls.Add(ro
w1);
}
}
if i insert br like that i am getting error like cannot convert string to control
Start Free Trial