below is the code I have but I want to change the ddl.Deal(dropdownlist) to cbl.Deal(checkboxlist).. How can I loop throught each items if checked. and if all items are checked. to filter my data and show in gridview..
protected void btn_Click(object sender, EventArgs e)
{
myAPI.myWeb myAPI = new myAPI.myWeb();
myAPI.SearchParameters sSearchParameters = new myAPI.SearchParameters();
DataSet ds = new DataSet();
DataTable dtFilt= new DataTable();
DataSet dsFilt = new DataSet();
DateTime dtmStartDate;
DateTime dtmEndDate;
dtmStartDate = Convert.ToDateTime(txtStartDate.Text);
dtmEndDate = Convert.ToDateTime(txtEndDate.Text);
//using dropdownlist but I want to change it to cblDeal (checkboxlist)
intDeal = Convert.ToInt32(ddlDeal.SelectedValue);
int[] intDealID = new int[] { intDeal };
SearchParameters.DealID = intDealerID;
SearchParameters.StartDate = dtmStartDate;
SearchParameters.EndDate = dtmEndDate;
//shows gridview with chosen columns to view
ds = myAPI.Order(SearchParameters);
dtFiltered.Columns.Add("O ID", typeof(string));
dtFiltered.Columns.Add("P ID", typeof(string));
dtFiltered.Columns.Add("C", typeof(string));
dtFiltered.Columns.Add("F", typeof(string));
dtFiltered.Columns.Add("D", typeof(string));
dtFiltered.Columns.Add("S", typeof(string));
foreach (DataRow row in ds.Tables[0].Rows)
{
DataRow newRow = dtFiltered.NewRow();
newRow["O ID"] = row["OID"].ToString();
newRow["P ID"] = row["PID"].ToString();
newRow["C"] = row["C"].ToString();
newRow["F"] = row["F"].ToString();
newRow["D"] = row["DCID"].ToString();
newRow["S"] = row["S"].ToString();
dtFiltered.Rows.Add(newRow);
}
dsFiltered.Tables.Add(dtFilt);
GridView1.DataSource = dsFilt;
GridView1.DataBind();
}