With refrence to :
http://www.aspforums.net/Threads/167129/how-to-create-two-dimensional-arraylist-and-save-that-in-viewstate/?p=1#Replies
Azim said :
No you cannot add a third parameter in the Dictionary. It contain Key Value pair data.
But if you want to add third parameter then simply use DataTable and add these in the DataTable row.
Name of Builder , Title Of Buidler , Builder ID
so how to acheive that task ? so far i did like this :
public void AddNewCMP(string PersonName , string PersonID , string PersonTitle)
{
var dt = new DataTable();
if (ViewState["CMPDataTable"] != null)
{
dt = (DataTable)ViewState["CMPDataTable"];
}
else
{
dt.Columns.Add("ProjectName");
dt.Columns.Add("PersonName");
dt.Columns.Add("PersonID");
dt.Columns.Add("Title");
}
string projName = null;
foreach (DataListItem item in myDataList.Items)
{
projName = ((TextBox)(item.FindControl("ProjectNames"))).Text;
}
DataRow drow = dt.NewRow();
drow["ProjectName"] = projName;
drow["PersonName"] = PersonName;
drow["PersonID"] = PersonID;
drow["Title"] = PersonTitle;
dt.Rows.Add(drow);
ViewState["CMPDataTable"] = dt;
ClearBuilderFields();
}
public void BindMyGridviewCMP()
{
if (ViewState["CMPDataTable"] != null)
{
var dt = (DataTable)ViewState["CMPDataTable"];
if ((dt != null) && (dt.Rows.Count > 0))
{
CMPProjectGrid.Visible = true;
CMPProjectGrid.DataSource = dt;
CMPProjectGrid.DataBind();
}
else
{
CMPProjectGrid.Visible = false;
}
}
}
now on button click i want to add six drop down values to AddNewRow(value1,value2,value3) method .... how to do that ?