public void BindGrid() { int custid; custid = Convert.ToInt16(drpRegion.SelectedValue); colservicewindow = objservicewindow.Get_All(); BLLCollection <ServiceWindow_mst> colservicewindow1 = new BLLCollection <ServiceWindow_mst>(); foreach (ServiceWindow_mst obj in colservicewindow) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colservicewindow1.Add(obj); } } grdvwViewServiceWindow.DataSource = colservicewindow1; grdvwViewServiceWindow.DataBind(); }