protected void Grid1_OnRebind(object sender, EventArgs e) { BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); try { Grid1.DataSource = null; Grid1.DataBind(); CustomProfile profile = CustomProfile.GetProfile(); HiddenField hdn = (HiddenField)UCProductSearchWTW.FindControl("hdnProductSearchSelectedRec"); List <BrilliantWMS.WMSOutbound.WMS_SP_GetPartDetail_ForTransfer_Result> TRPartList = new List <WMSOutbound.WMS_SP_GetPartDetail_ForTransfer_Result>(); if (hdn.Value == "") { TRPartList = Outbound.GetExistingTempDataBySessionIDObjectNameTR(Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList(); } else if (hdn.Value != "") { TRPartList = Outbound.AddPartIntoTransfer_TempDataTR(hdn.Value, Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, Convert.ToInt32(hdnFrmWarehouse.Value), profile.DBConnection._constr).ToList(); } Grid1.DataSource = TRPartList; Grid1.DataBind(); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "WToWTransferDetail.aspx", "Grid1_OnRebind"); } finally { Outbound.Close(); } }