using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxEditors;
public partial class eOPS_Orders_FNB_Stock_PurchaseOrder : System.Web.UI.Page
{
List<string> controlIdList = new List<string>();
int counter = 0;
protected override void LoadViewState(object savedState)
{
base.LoadViewState(savedState);
controlIdList = (List<string>)ViewState["controlIdList"];
foreach (string id in controlIdList)
{
counter++;
ASPxComboBox Cb = new ASPxComboBox();
Cb.ID = "SkuComboBox" + counter;
Cb.DataSource = sdSku;
Cb.TextField = "SkU";
Cb.ValueField = "SkU";
Cb.ValueType = typeof(string);
Cb.Columns.Add("SKU");
Cb.Columns.Add("Model");
Cb.Columns.Add("Name");
Cb.Attributes.Add("runat", "server");
Cb.DataSource = sdSku;
Cb.DataBind();
ASPxLabel Lb = new ASPxLabel();
Lb.Text = "Select SKU";
Lb.ID = "Label"+counter;
Table tb = new Table();
TableRow tr = new TableRow();
TableCell tc = new TableCell();
TableCell tc2 = new TableCell();
tc.Controls.Add(Lb);
tr.Cells.Add(tc);
tb.Controls.Add(tr);
tb.ID = id;
tc2.Controls.Add(Cb);
tr.Cells.Add(tc2);
tb.Rows.Add(tr);
PlaceholderSku.Controls.Add(tb);
PlaceholderSku.Controls.Add(new LiteralControl("<br/>"));
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnAddSku_Click(object sender, EventArgs e)
{
counter++;
Table tb = new Table();
tb.ID = "Table" + counter;
controlIdList.Add(tb.ID);
ViewState["controlIdList"] = controlIdList;
}
}