How create Listview for website in c# at runtime using code ?
Stuck how to add label,button in listview with event.
OR
the main issue is unable to add "ItemTemplate" in listview.
Requirment : "Need to add multiple listview in a panel using backend code."
So I create a Panel and use for loop for this. I am able to add label, dropdownlist(with selectedindexchange event), button with Panel.
But stuck in adding listview to Panel.
There is option in windows application. But stuck for webapplication, unable to found any solution.
please provide a usefull link or any suggestion how can I proceed.
Edit: You can Rate it to 1. But please comment also, So I can improve my question or provide more detail's.
What I have tried:
DataTable dt_att= getdatafromFunction();
for (int i = 0; i < dt_att.Rows.Count; i++)
{
DataTable dt_at_value = getdatafromFunction2(dt_att.Rows[i]["id"].ToString());
ListView listView1 = new ListView();
listView1.LayoutTemplate = new LayoutTemplate();
listView1.ItemTemplate = new ItemTemplate();
listView1.DataSource = dt_at_value;
listView1.DataBind();
listView1.ItemDataBound += new EventHandler<ListViewItemEventArgs>(lst_attribute_ItemDataBound);
listView1.ItemCommand += new EventHandler<ListViewCommandEventArgs>(lst_attribute_ItemCommand);
pnl_attributelist.Controls.Add(listView1);
}