protected void gridPerformance_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { DateTime fechaInicial = Convert.ToDateTime(hdfFechaInicial.Value); DateTime fechaFinal = Convert.ToDateTime(hdfFechaFinal.Value); PerformanceIngenieriaCOM PerformanceIngenieria = new PerformanceIngenieriaCOM(); GridDataItem dataItem = ((GridDataItem)e.DetailTableView.ParentItem); string Login = dataItem.GetDataKeyValue("Login").ToString(); //GridTableView nestedTableView = (RadGrid1.MasterTableView.Items[0] as GridDataItem).ChildItem.NestedTableViews[0]; if (dataItem.Edit) { return; } if (e.DetailTableView.DetailTableIndex == 0) { //DataSet ds = (DataSet)e.DetailTableView.DataSource; //e.DetailTableView.DataSource = ds.Tables["Dashboard_Preventa_Ingenieria"].Select("Login = '******'"); e.DetailTableView.DataSource = PerformanceIngenieria.spq_Dashboard_Preventa_Ingenieria(fechaInicial, fechaFinal, Login); } else if (e.DetailTableView.DetailTableIndex == 1) { //DataSet ds = (DataSet)e.DetailTableView.DataSource; //e.DetailTableView.DataSource = ds.Tables["Performance_Ingenieria"].Select("Login = '******'"); e.DetailTableView.DataSource = PerformanceIngenieria.spq_Performance_Ingenieria(fechaInicial, fechaFinal, Login); } else if (e.DetailTableView.DetailTableIndex == 2) { //DataSet ds = (DataSet)e.DetailTableView.DataSource; //e.DetailTableView.DataSource = ds.Tables["Sailine"].Select("Login = '******'"); e.DetailTableView.DataSource = PerformanceIngenieria.spq_Performance_Ingenieria_sailine(fechaInicial, fechaFinal, Login); } }
// overtime detail tables data loading and binding protected void gvEmployee_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "EmpExpTypeDetail": { string id = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@ID", id); dtEmpExpTypeDetail = clsDAL.GetDataSet_Payroll("sp_Payroll_Get_EmpExpenseTypeAssignment_Records", ht).Tables[0]; dtEmpExpTypeDetail.TableName = "EmpExpTypeDetail"; e.DetailTableView.DataSource = dtEmpExpTypeDetail; e.DetailTableView.DataMember = "EmpExpTypeDetail"; break; } case "EmpExpSubTypeDetail": { Hashtable ht = new Hashtable(); ht.Add("@exptidd", dataItem.GetDataKeyValue("exptidd").ToString()); ht.Add("@empidd", dataItem.GetDataKeyValue("empidd").ToString()); dtEmpExpSubTypeDetail = clsDAL.GetDataSet_Payroll("sp_Payroll_Get_EmpExpenseSubTypeAssignment_Records", ht).Tables[0]; dtEmpExpSubTypeDetail.TableName = "EmpExpSubTypeDetail"; e.DetailTableView.DataSource = dtEmpExpSubTypeDetail; e.DetailTableView.DataMember = "EmpExpSubTypeDetail"; break; } } }
protected void radGridLiveOrder_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string menuId = dataItem.GetDataKeyValue("MenuId").ToString(); e.DetailTableView.DataSource = _orderManagement.GetAllApprovedMenuDetails(Convert.ToInt64(menuId)); }
protected void grdMetas_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem vDataItem = (GridDataItem)e.DetailTableView.ParentItem; vListaMetas = new List <E_META>(); if (e.DetailTableView.Name == "gtvMetas") { PeriodoDesempenoNegocio nPeriodo = new PeriodoDesempenoNegocio(); vIdEmpleado = int.Parse(vDataItem.GetDataKeyValue("ID_EVALUADO").ToString()); vSumaEvaluadas = 0; vListaMetas = nPeriodo.ObtieneMetas(vIdPeriodo, vIdEmpleado); e.DetailTableView.DataSource = vListaMetas; foreach (E_META Item in vListaMetas) { int vIdEval_Metas = int.Parse(Item.ID_EVALUADO.ToString()); bool vfgEvalua = bool.Parse(Item.FG_EVALUAR.ToString()); if (vIdEval_Metas == vIdEmpleado) { if (vfgEvalua == true) { vSumaEvaluadas += decimal.Parse(Item.PR_META.ToString()); } } } } }
protected void grdOrderDetail_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { if (e.DetailTableView.Name.Equals("OrderDetailAdon")) { GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem; long orderDetailId = (long)parentItem.GetDataKeyValue("OrderDetailID"); ICollection <OrderDetailAdOns> orderDetailAdons = new List <OrderDetailAdOns>(); ICollection <OrderDetails> orderDetails = (ICollection <OrderDetails>)e.DetailTableView.DataSource; OrderDetails orderDetail = orderDetails.Where(od => od.OrderDetailID == orderDetailId).First(); if (!String.IsNullOrEmpty(orderDetail.OrderDetailAdOnsXml)) { orderDetailAdons = Core.Utility.XmlToObjectList <OrderDetailAdOns>(orderDetail.OrderDetailAdOnsXml, "//OrderDetailAdOns/OrderDetailAdOn"); } e.DetailTableView.DataSource = orderDetailAdons; } else if (e.DetailTableView.Name.Equals("OrderDetailOption")) { GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem; long orderDetailId = (long)parentItem.GetDataKeyValue("OrderDetailID"); ICollection <OrderDetailOptions> orderDetailOptions = new List <OrderDetailOptions>(); ICollection <OrderDetails> orderDetails = (ICollection <OrderDetails>)e.DetailTableView.DataSource; OrderDetails orderDetail = orderDetails.Where(od => od.OrderDetailID == orderDetailId).First(); if (!String.IsNullOrEmpty(orderDetail.OrderDetailOptionXml)) { orderDetailOptions = Core.Utility.XmlToObjectList <OrderDetailOptions>(orderDetail.OrderDetailOptionXml, "//OrderDetailOptions/OrderDetailOption"); } e.DetailTableView.DataSource = orderDetailOptions; } }
// detail tables data loading and binding protected void gvDivision_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Departments": { string ID = dataItem.GetDataKeyValue("dividd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@DivisionID", ID); dtDepartments = clsDAL.GetDataSet_Payroll("sp_Payroll_Get_Departments", ht).Tables[0]; dtDepartments.TableName = "Department"; e.DetailTableView.DataSource = dtDepartments; e.DetailTableView.DataMember = "Departments"; break; } case "Sections": { string ID = dataItem.GetDataKeyValue("dptidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@DepartmentID", ID); dtSections = clsDAL.GetDataSet_Payroll("sp_Payroll_Get_Sections", ht).Tables[0]; dtSections.TableName = "Sections"; e.DetailTableView.DataSource = dtSections; e.DetailTableView.DataMember = "Sections"; break; } } }
// detail tables data binding protected void gvPayCode_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Citizens": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@PayCodeID", ID); DataTable dt = clsDAL.GetDataSet_Payroll("sp_Payroll_GetPayCodeCitizens", ht).Tables[0]; dt.TableName = "Citizens"; e.DetailTableView.DataSource = dt; e.DetailTableView.DataMember = "Citizens"; break; } case "Expatriate": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@PayCodeID", ID); DataTable dt = clsDAL.GetDataSet_Payroll("sp_Payroll_GetPayCodeExpatriate", ht).Tables[0]; dt.TableName = "Expatriate"; e.DetailTableView.DataSource = dt; e.DetailTableView.DataMember = "Expatriate"; break; } } }
protected void gridMain_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { if (e.DetailTableView.Name == "FormulaDetails") { GridTableView detailtabl = (GridTableView)e.DetailTableView; int recSkip = detailtabl.CurrentPageIndex * gridMain.PageSize; int recTake = detailtabl.PageSize; GridDataItem parentItem = (GridDataItem)detailtabl.ParentItem; int salesID = int.Parse(parentItem.GetDataKeyValue("ID").ToString()); JobFormulasController cont = new JobFormulasController(); detailtabl.VirtualItemCount = cont.CountJobFormulas(salesID); detailtabl.DataSource = cont.GetJobFormulas(salesID, recSkip, recTake); } else if (e.DetailTableView.Name == "CancelDetails") { GridTableView detailtabl = (GridTableView)e.DetailTableView; int recSkip = detailtabl.CurrentPageIndex * gridMain.PageSize; int recTake = detailtabl.PageSize; GridDataItem parentItem = (GridDataItem)detailtabl.ParentItem; int salesID = int.Parse(parentItem.GetDataKeyValue("ID").ToString()); JobCancelPricesController cont = new JobCancelPricesController(); detailtabl.VirtualItemCount = cont.CountJobCancelPrices(salesID); detailtabl.DataSource = cont.GetJobCancelPrices(salesID, recSkip, recTake); } }
// detail grid data loading and binding protected void gvCountry_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "City": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@ID", ID); dtCity = clsDAL.GetDataSet_Payroll("sp_payroll_GetCountryCities", ht).Tables[0]; dtCity.TableName = "City"; e.DetailTableView.DataSource = dtCity; e.DetailTableView.DataMember = "City"; break; } case "Province": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@ID", ID); dtProvince = clsDAL.GetDataSet_Payroll("sp_payroll_GetCountryProvinces", ht).Tables[0]; dtProvince.TableName = "Province"; e.DetailTableView.DataSource = dtProvince; e.DetailTableView.DataMember = "Province"; break; } } }
// grid detail tables data loading and binding protected void gvEmployee_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "EmpLeaveTypes": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@EmpId", ID); dtEmpLeaves = clsDAL.GetDataSet_Payroll("sp_Payroll_GetEmployeeLeaveRecords", ht).Tables[0]; dtEmpLeaves.TableName = "EmpLeaveTypes"; e.DetailTableView.DataSource = dtEmpLeaves; e.DetailTableView.DataMember = "EmpLeaveTypes"; break; } case "EmpLeaves": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@EmplevId", ID); dtEmpLeaves = clsDAL.GetDataSet_Payroll("sp_Payroll_GetEmployeeLeaveRecordsDetail", ht).Tables[0]; dtEmpLeaves.TableName = "EmpLeaves"; e.DetailTableView.DataSource = dtEmpLeaves; e.DetailTableView.DataMember = "EmpLeaves"; break; } } }
/// <summary> /// Handles the <see cref="RadGrid.DetailTableDataBind"/> event of the <see cref="JobsGrid"/> control. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="e">The <see cref="GridDetailTableDataBindEventArgs"/> instance containing the event data.</param> private void JobsGrid_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { var parentRow = e.DetailTableView.ParentItem; var parentJobId = (int)parentRow.GetDataKeyValue("JobId"); e.DetailTableView.ExpandCollapseColumn.Display = false; e.DetailTableView.Columns.FindByUniqueName("ApplicationStatus").Visible = this.ShowApplicationStatuses(); ////var userIds = this.UserStatusId.HasValue //// ? UserStatusInfo.GetUsersWithStatus(this.PortalSettings, this.UserStatusId.Value).Select(user => user.UserId) //// : Enumerable.Empty<int>(); int unpagedApplicationCount; e.DetailTableView.DataSource = JobApplication.LoadApplicationsForJob( parentJobId, this.JobGroupId, this.ApplicationStatusId, this.UserStatusId, (int?)this.ViewState["LeadId"], (DateTime?)this.ViewState["DateFrom"], (DateTime?)this.ViewState["DateTo"], e.DetailTableView.CurrentPageIndex, this.IsExport ? (int?)null : e.DetailTableView.PageSize, out unpagedApplicationCount, true); e.DetailTableView.VirtualItemCount = unpagedApplicationCount; }
protected void grdEntities_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { RadGrid grdEntities = ctrlSearch.FindControl <RadGrid>("grdEntities"); List <GridEntity> allEntities = (base.Datasource as List <GridEntity>).OrderBy(ent => ent.DisplayOrder).ThenBy(ent => ent.LocaleName).ToList(); GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; int parentID = int.Parse(dataItem.GetDataKeyValue("ID").ToString()); IList <GridEntity> allChildEntities = GridEntity.GetChildrenEntities(EntityType, parentID); var chkShowDeleted = ctrlSearch.FindControl <CheckBox>("chkShowDeleted"); if (chkShowDeleted != null && !chkShowDeleted.Checked) { allChildEntities = allChildEntities.Where(ent => !ent.Deleted).ToList(); } var filterString = this.CurrentFilter; if (!String.IsNullOrEmpty(filterString)) { allChildEntities = allChildEntities.Where(item => IsFilterSearchMatch(CurrentFilterType, filterString, item, allEntities)).ToList(); } e.DetailTableView.DataSource = allChildEntities; }
protected void grdConference_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { if (e.DetailTableView.Name.SafeEquals("ConferenceFeeTypes")) { int conferenceId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("ConferenceId"); e.DetailTableView.DataSource = ConferenceFeeManager.LoadOnConferenceId(conferenceId).ToList(); } }
protected void RadGrid1_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem item = e.DetailTableView.ParentItem as GridDataItem; object idObj = item.GetDataKeyValue("Id"); int id = Convert.ToInt32(idObj); e.DetailTableView.DataSource = bdent.Items.Where(x => x.Id == id).ToList(); }
protected void rgResultadosPreguntas_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem datItem = (GridDataItem)e.DetailTableView.ParentItem; int vIdPregunta = int.Parse(datItem.GetDataKeyValue("ID_PREGUNTA").ToString()); ClimaLaboralNegocio nClima = new ClimaLaboralNegocio(); e.DetailTableView.DataSource = nClima.ObtenerRespuestasAbiertas(pIdPeriodo: vIdPeriodo, pIdPregunta: vIdPregunta, pXmlFiltros: vXmlFiltrosPre, pIdRol: vIdRol).ToList(); }
protected void StoreDelivGroupsRadGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; StoreDelivCriteriaDAO storeDelivCriteria = new StoreDelivCriteriaDAO(); string storeDelivGroupId = dataItem.GetDataKeyValue("group_id").ToString(); e.DetailTableView.DataSource = storeDelivCriteria.GetStoreDelivCriteria(storeDelivGroupId).Tables[0]; }
protected void LanesRadGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; CagetypeServiceDAO cts = new CagetypeServiceDAO(); string cageTypeId = dataItem.GetDataKeyValue("cage_type_id").ToString(); e.DetailTableView.DataSource = cts.GetCageServices(cageTypeId).Tables[0]; }
protected void grdRequisicion_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { RequisicionNegocio nReq = new RequisicionNegocio(); GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; int vIdRequisicion = int.Parse(dataItem.GetDataKeyValue("ID_REQUISICION").ToString()); e.DetailTableView.DataSource = nReq.ObtenerCandidatosPorRequisicion(pIdRequisicion: vIdRequisicion); }
protected void rgCurrentStatus_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; int site_id = Convert.ToInt32(dataItem.GetDataKeyValue("site_id")); var data = db.vEndangeredGagesHistories.Where(p => p.site_id == site_id).OrderBy(p => p.rms_record_id).ThenBy(p => p.entered_dt).ToList(); e.DetailTableView.DataSource = data; }
protected void rgCoopFunding_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; if (e.DetailTableView.Name == "Accounts") { var AgreementID = Convert.ToInt32(dataItem.GetDataKeyValue("AgreementID")); e.DetailTableView.DataSource = siftaDB.CooperativeFundings.Where(p => p.AgreementID == AgreementID).OrderBy(p => p.FiscalYear); } }
/// <summary> /// Grid Curriculum Detail table /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdCurriculum_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataitem = (GridDataItem)e.DetailTableView.ParentItem; int tcKey = Convert.ToInt32(dataitem.GetDataKeyValue("tcc_key").ToString()); wsEmployeePosition = new WsEmployeePosition(); dsTraining = wsEmployeePosition.GetTrainingByCurriculum(tcKey); wsEmployeePosition = null; e.DetailTableView.DataSource = dsTraining; }
void gvPreInvoices_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem; if (parentItem.Edit) { return; } Facade.IPreInvoice facPreInvoice = new Facade.PreInvoice(); e.DetailTableView.DataSource = facPreInvoice.GetItemsForPreInvoice(int.Parse(parentItem.GetDataKeyValue("PreInvoiceID").ToString())); }
protected void gridMain_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridTableView detailtabl = e.DetailTableView; int recSkip = detailtabl.CurrentPageIndex * gridMain.PageSize; int recTake = detailtabl.PageSize; GridDataItem parentItem = detailtabl.ParentItem; int customerID = int.Parse(parentItem.GetDataKeyValue("ID").ToString()); FilesController cont = new FilesController(); detailtabl.VirtualItemCount = cont.CountFilesByCustomerID(customerID); detailtabl.DataSource = cont.GetFilesByCustomerID(customerID, recSkip, recTake); }
void gridJQFactorItems_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { try { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; JQManager jqm = new JQManager(); switch (e.DetailTableView.Name) { case "RatingScale": { long ratingScaleID = (long)dataItem.GetDataKeyValue("RatingScaleID"); // pull rating scale from cached version JQRatingScaleCollection cachedScaleList = LookupWrapper.GetJQRatingScale(false); JQRatingScale ratingScale = cachedScaleList.Find(ratingScaleID); JQRatingScaleCollection newScaleList = new JQRatingScaleCollection(); if (ratingScale != null) { // account for blank/null instructions ratingScale.RatingScaleInstruction = string.IsNullOrWhiteSpace(ratingScale.RatingScaleInstruction) ? GetLocalResourceObject("MissingInstructionsText").ToString() : ratingScale.RatingScaleInstruction; newScaleList.Add(ratingScale); } e.DetailTableView.DataSource = newScaleList; break; } case "RatingScaleResponses": { long ratingScaleID = (long)dataItem.GetDataKeyValue("RatingScaleID"); RatingScaleResponseCollection responseItemList = this.RatingScaleResponses.FindByScale(ratingScaleID); if (responseItemList.Count == 0) { RatingScaleResponseCollection listResponses = jqm.GetJQRatingScaleResponseCollectionByFactorItemID(ratingScaleID); this.RatingScaleResponses.AddRange(listResponses); responseItemList = listResponses; } e.DetailTableView.DataSource = responseItemList; break; } } } catch (Exception ex) { base.HandleException(ex); } }
protected void RGGoodsDemandDetail_NeedDataSource(object source, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = e.DetailTableView.ParentItem; var realGoodsId = new Guid(dataItem.GetDataKeyValue("RealGoodsId").ToString()); var dataList = StockDeclareDtos.Where(ent => ent.RealGoodsId == realGoodsId); foreach (var purchaseDeclarationDTO in dataList) { purchaseDeclarationDTO.PurchaseQuantity = purchaseDeclarationDTO.PurchaseQuantity == 0 ? purchaseDeclarationDTO.Quantity : purchaseDeclarationDTO.PurchaseQuantity; } e.DetailTableView.DataSource = dataList; }
protected void rgInventory_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; using (var context = new cathlabEntities()) { string PartNum = dataItem.GetDataKeyValue("PartNumber").ToString(); int LocationID = (int)dataItem.GetDataKeyValue("LocationID"); var temp = (from prod in context.Products where prod.PartNumber == PartNum && prod.LocationID == LocationID select new { prod.Location.LocationName, prod.LotNumber, prod.SerialNumber, prod.ExpirationDate }); e.DetailTableView.DataSource = temp.ToList(); } }
protected void reportGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem gridDataItem = e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Responses": { string question = gridDataItem.GetDataKeyValue("Question").ToString(); e.DetailTableView.DataSource = LoadResponses(question); break; } } }
protected void grvNhomChucDanh_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "tbl_ChucDanhChuyenMon": { int iDNhomChucDanh = Convert.ToInt32(dataItem.GetDataKeyValue("IDNhomChucDanh").ToString()); e.DetailTableView.DataSource = _entities.GetAllChucDanh().Where(o => o.IDNhomChucDanh == iDNhomChucDanh); break; } } }
protected void radgrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; /* * radgrid.MasterTableView.DetailTables[0].DataSource = (DataView)dsDevices.Select(DataSourceSelectArguments.Empty); * radgrid.MasterTableView.DetailTables[1].DataSource = (DataView)dsEvents.Select(DataSourceSelectArguments.Empty); * radgrid.MasterTableView.DetailTables[0].DetailTables[0].DataSource = (DataView)dsService.Select(DataSourceSelectArguments.Empty); * radgrid.MasterTableView.DetailTables[1].DetailTables[0].DataSource = (DataView)dsEventWork.Select(DataSourceSelectArguments.Empty); * */ switch (e.DetailTableView.Name) { case "Device": { string WPID = dataItem.GetDataKeyValue("ID").ToString(); dsDevices.SelectParameters.Clear(); dsDevices.SelectParameters.Add("WPID", DbType.Int32, WPID); e.DetailTableView.DataSource = (DataView)dsDevices.Select(DataSourceSelectArguments.Empty); break; } case "Event": { string WPID = dataItem.GetDataKeyValue("ID").ToString(); dsEvents.SelectParameters.Clear(); dsEvents.SelectParameters.Add("WPID", DbType.Int32, WPID); e.DetailTableView.DataSource = (DataView)dsEvents.Select(DataSourceSelectArguments.Empty); break; } case "Works": { string WPEventID = dataItem.GetDataKeyValue("ID").ToString(); dsEventWork.SelectParameters.Clear(); dsEventWork.SelectParameters.Add("WPEventID", DbType.Int32, WPEventID); e.DetailTableView.DataSource = (DataView)dsEventWork.Select(DataSourceSelectArguments.Empty); break; } case "Service": { string WPDeviceID = dataItem.GetDataKeyValue("ID").ToString(); dsService.SelectParameters.Clear(); dsService.SelectParameters.Add("DeviceID", DbType.Int32, WPDeviceID); e.DetailTableView.DataSource = (DataView)dsService.Select(DataSourceSelectArguments.Empty); break; } } }
// calender detail table data loading and binding protected void gvCalender_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "Holidays": { string ID = dataItem.GetDataKeyValue("recidd").ToString(); Hashtable ht = new Hashtable(); ht.Add("@CalID", ID); dtHolidays = clsDAL.GetDataSet_Payroll("sp_Payroll_GetCalenderHolidays", ht).Tables[0]; dtHolidays.TableName = "Holidays"; e.DetailTableView.DataSource = dtHolidays; e.DetailTableView.DataMember = "Holidays"; break; } case "Shift": { dtShift = clsCommon.DDLValueSet_GetByDDLID_FromCentralDb(Constraints.DropDownLists.CalenderShift, -1, 1).Tables[0]; dtShift.TableName = "Shift"; e.DetailTableView.DataSource = dtShift; e.DetailTableView.DataMember = "Shift"; break; } case "ShiftDetail": { string calID = dataItem.OwnerTableView.ParentItem.OwnerTableView.DataKeyValues[dataItem.OwnerTableView.ParentItem.ItemIndex]["recidd"].ToString(); string shiftID = dataItem.GetDataKeyValue("ValueSetID").ToString(); Hashtable ht = new Hashtable(); ht.Add("@CalID", calID); ht.Add("@ShftID", shiftID); dtShiftDetail = clsDAL.GetDataSet_Payroll("sp_Payroll_GetCalenderShift", ht).Tables[0]; dtShiftDetail.TableName = "ShiftDetail"; e.DetailTableView.DataSource = dtShiftDetail; e.DetailTableView.DataMember = "ShiftDetail"; break; } } }
protected void grdProducts_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { RadGrid grdProducts = ctrlSearch.FindControl <RadGrid>("grdProducts"); GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; int pID = int.Parse(dataItem.GetDataKeyValue("ProductID").ToString()); GridProduct p = new GridProduct(pID); if (p.Variants.Count() == 0) { p.LoadVariants(true); } e.DetailTableView.DataSource = p.Variants; }
protected void RadGrid1_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { if (e.DetailTableView.Name == "RelatedItems") { int itemId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("ID"); e.DetailTableView.DataSource = BusinessDataStorage.GetHierarchicalData(itemId); } else if (e.DetailTableView.Name == "InnerMost") { int catId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("CategoryID"); e.DetailTableView.DataSource = BusinessDataStorage.GetData(catId); } else { int catId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("ID"); e.DetailTableView.DataSource = BusinessDataStorage.GetData(catId); } }
protected void grdConference_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { switch (e.DetailTableView.Name) { case "Event": int conferenceId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("ConferenceId"); e.DetailTableView.DataSource = ConferenceEventsViewManager.LoadByConferenceId(conferenceId).ToList(); Conference conference = ConferenceManager.Load(conferenceId); if (conference != null) { e.DetailTableView.CommandItemDisplay = Roles.IsUserInRole("Member") && !conference.IsConferenceEnrollmentExpired ? GridCommandItemDisplay.Top : GridCommandItemDisplay.None; } break; } }
protected void grdresults_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { if (e.DetailTableView.Name.SafeEquals("ItemDetails")) { if (!User.Identity.IsAuthenticated) { e.DetailTableView.Columns[0].Visible = false; } int inventoryId = (int)e.DetailTableView.ParentItem.GetDataKeyValue("InventoryId"); List<Inventory> inventories = new List<Inventory>(); Inventory inventory = InventoryManager.Load(inventoryId); inventories.Add(inventory); e.DetailTableView.DataSource = inventories; } }
protected void RadGrid1_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem; if (parentItem.Edit) { return; } //if (e.DetailTableView.DataMember == "OrderDetails") //{ //DataSet ds = (DataSet)e.DetailTableView.DataSource; //DataView dv = ds.Tables["OrderDetails"].DefaultView; //dv.RowFilter = "CustomerID = '" + parentItem["CustomerID"].Text + "'"; //e.DetailTableView.DataSource = dv; GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string strAuditTrailID = dataItem.GetDataKeyValue("AuditID").ToString(); WS.AllLifePrincingClient WS = new WS.AllLifePrincingClient(); string strSettingValue = string.Empty; SqlConnection sqlConnectionX; SqlCommand sqlCommandX; SqlParameter sqlParam; SqlDataReader sqlDR; try { sqlConnectionX = new SqlConnection(ConfigurationManager.AppSettings["SQLConnection"]); sqlConnectionX.Open(); sqlCommandX = new SqlCommand(); sqlCommandX.Connection = sqlConnectionX; sqlCommandX.CommandType = CommandType.StoredProcedure; sqlCommandX.CommandText = "spx_SELECT_QuoteOptionAuditTrailByAuditTrailID"; sqlParam = new SqlParameter("QuoteAuditTrailID", strAuditTrailID); sqlCommandX.Parameters.Add(sqlParam); sqlDR = sqlCommandX.ExecuteReader(); DataTable dt = new DataTable("AuditTrail"); dt.Load(sqlDR); sqlDR.Close(); sqlCommandX.Cancel(); sqlCommandX.Dispose(); sqlConnectionX.Close(); e.DetailTableView.DataSource = dt; } catch (Exception ex) { lblInfo.Text = ex.Message; } //} }
protected void OrdersDetailedTabel_DetailTable(object source, GridDetailTableDataBindEventArgs e) { var dbContext = new DataClasses1DataContext(); var _item = (GridDataItem)e.DetailTableView.ParentItem; var listId = Int32.Parse(_item["listId"].Text); var orderQuery = from ord in dbContext.Order where ord.PackingListNumber == listId && ord.Status == (int)OrderStatusTypes.Closed && ord.HasError.GetValueOrDefault(false) != true select new { OrderNumber = ord.OrderNumber, CustomerName = ord.Customer.SmallCustomer != null && ord.Customer.SmallCustomer.Person != null ? ord.Customer.SmallCustomer.Person.FirstName + " " + ord.Customer.SmallCustomer.Person.Name : ord.Customer.Name, OrderLocation = ord.Location.Name, Status = ord.OrderStatus.Name, OrderType = ord.OrderType.Name, OrderError = ord.HasError == true ? "Ja" : "Nein" }; var item = (GridDataItem)e.DetailTableView.ParentItem; var nestedItem = (GridNestedViewItem)item.ChildItem; var radGrdEnquiriesVarients = (RadGrid)nestedItem.FindControl("RadGridVersandDetails"); radGrdEnquiriesVarients.DataSource = orderQuery; radGrdEnquiriesVarients.DataBind(); }
//void GridTableView_Load(object sender, EventArgs e) //{ // GridTableView table = (GridTableView)sender; // foreach (GridDataItem item in table.Items) // { // if (item.Expanded) // { // //build the item key that will be used to save the item as expanded // string itemKey = BuildItemKey(item); // if (!ExpandedItemKeys.Contains(itemKey)) // { // ExpandedItemKeys.Add(itemKey); // } // } // } //} //void GridTableView_DataBound(object sender, EventArgs e) //{ // GridTableView table = (GridTableView)sender; // foreach (GridDataItem item in table.Items) // { // string itemKey = BuildItemKey(item); // //if the item key is contained in the collection of saved items // //this means the item should be expanded // if (!item.Expanded && ExpandedItemKeys.Contains(itemKey)) // { // item.Expanded = true; // ExpandedItemKeys.Remove(itemKey); // } // } //} ///// <summary> ///// Build an item key that will uniquely identify a grid item ///// among all the items in the RadGrid hierarchy. Use a combination ///// of the OwnerTableView.UniqueID and the set of all data values. ///// </summary> //protected string BuildItemKey(GridDataItem item) //{ // string[] keyNames = item.OwnerTableView.DataKeyNames; // if (keyNames.Length == 0) return item.ItemIndexHierarchical; // string returnKey = item.OwnerTableView.UniqueID + "::"; // foreach (string keyName in keyNames) // { // string val = item.GetDataKeyValue(keyName).ToString(); // OrderNo = val; // returnKey += val; // if (keyName != keyNames[keyNames.Length - 1]) // { // returnKey += "::"; // } // } // return returnKey; //} ///// <summary> ///// Gets the expanded item state saved in the Session ///// </summary> //protected List<string> ExpandedItemKeys //{ // get // { // if (Session["ExpandedItemKeys"] == null) // { // Session["ExpandedItemKeys"] = new List<string>(); // } // return (List<string>)Session["ExpandedItemKeys"]; // } //} protected void RadGrid1_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { OrderNo = (string)e.DetailTableView.ParentItem.GetDataKeyValue("ordNo"); e.DetailTableView.DataSource = SqlDataSource1; }
/// <summary> /// Handles the <see cref="RadGrid.DetailTableDataBind"/> event of the <see cref="JobsGrid"/> control. /// </summary> /// <param name="source">The source of the event.</param> /// <param name="e">The <see cref="GridDetailTableDataBindEventArgs"/> instance containing the event data.</param> private void JobsGrid_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { var parentRow = e.DetailTableView.ParentItem; var parentJobId = (int)parentRow.GetDataKeyValue("JobId"); e.DetailTableView.ExpandCollapseColumn.Display = false; e.DetailTableView.Columns.FindByUniqueName("ApplicationStatus").Visible = this.ShowApplicationStatuses(); ////var userIds = this.UserStatusId.HasValue //// ? UserStatusInfo.GetUsersWithStatus(this.PortalSettings, this.UserStatusId.Value).Select(user => user.UserId) //// : Enumerable.Empty<int>(); int unpagedApplicationCount; e.DetailTableView.DataSource = JobApplication.LoadApplicationsForJob( parentJobId, this.JobGroupId, this.ApplicationStatusId, this.UserStatusId, (int?)this.ViewState["LeadId"], (DateTime?)this.ViewState["DateFrom"], (DateTime?)this.ViewState["DateTo"], e.DetailTableView.CurrentPageIndex, this.IsExport ? (int?)null : e.DetailTableView.PageSize, out unpagedApplicationCount, true); e.DetailTableView.VirtualItemCount = unpagedApplicationCount; }
protected void RadGridAllChanges_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { DataClasses1DataContext dbContext = new DataClasses1DataContext(); try { GridDataItem item = (GridDataItem)e.DetailTableView.ParentItem; string TableName = item["TableName"].Text.ToString(); string ReferenceId = item["ReferenceId"].Text.ToString(); GridDataItem dataItem = item; GridNestedViewItem nestedItem = (GridNestedViewItem)dataItem.ChildItem; RadGrid radGrdEnquiriesVarients = (RadGrid)nestedItem.FindControl("radGridDetailInfo"); DataTable t = new DataTable(); if (ReferenceId != string.Empty || TableName != string.Empty) { var tableColumns = dbContext.ChangeLogColumNames.SingleOrDefault(q => q.TableName == TableName); string thisSelect = ""; if (tableColumns != null) { string idName = tableColumns.IdColumnName; foreach (var col in tableColumns.ColumnNames.Split(';')) { if (thisSelect == string.Empty) { thisSelect = "[" + col + "]"; } else { thisSelect += ",[" + col + "]"; } } dbContext.Connection.Close(); string myQuery = ""; if (thisSelect != string.Empty && idName != string.Empty && TableName != string.Empty) { myQuery = "select " + thisSelect + " from [" + TableName + "] where " + idName + " ='" + ReferenceId + "'"; using (SqlConnection c = new SqlConnection(dbContext.Connection.ConnectionString)) { c.Open(); using (SqlDataAdapter a = new SqlDataAdapter(myQuery, c)) { a.Fill(t); } } radGrdEnquiriesVarients.DataSource = t; radGrdEnquiriesVarients.DataBind(); } } else { setEmptyDataSet(radGrdEnquiriesVarients, true); } } else { setEmptyDataSet(radGrdEnquiriesVarients, true); } } catch (Exception ex) { dbContext.WriteLogItem("Fehler beim generieren des ChangeLogs Details. " + ex.Message, LogTypes.ERROR); dbContext.SubmitChanges(); } }
protected void OnDetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { var oDataItem = e.DetailTableView.ParentItem; var iIAProductionOrderID = MemberProtect.Utility.ValidateInteger(oDataItem["IAProductionOrderID"].Text); e.DetailTableView.DataSource = DataAccess.IASpots.Where(row => row.IAProductionOrderID == iIAProductionOrderID); }
protected void OnDetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { var oDataItem = e.DetailTableView.ParentItem; var iIAJobID = MemberProtect.Utility.ValidateInteger(oDataItem["IAJobID"].Text); e.DetailTableView.DataSource = DataAccess.fn_Producer_GetProductionOrders(iIAJobID); }
//protected void CostCenterDataSourceLinq_Selected(object sender, LinqDataSourceSelectEventArgs e) //{ // DataClasses1DataContext con = new DataClasses1DataContext(); // var costCenterQuery = from cost in con.CostCenter // orderby cost.Name // select new // { // Name = cost.Name, // Value = cost.Id // }; // e.Result = costCenterQuery; //} /// <summary> /// Datasource fuer die Detailgrid /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void RadGridZulOffen_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { DataClasses1DataContext dbContext = new DataClasses1DataContext(); GridDataItem item = (GridDataItem)e.DetailTableView.ParentItem; Guid orderId = new Guid(item["OrderId"].Text.ToString()); var positionQuery = from ord in dbContext.Order join orditem in dbContext.OrderItem on ord.Id equals orditem.OrderId let authCharge = dbContext.OrderItem.FirstOrDefault(s => s.SuperOrderItemId == orditem.Id) where ord.Id == orderId && (orditem.SuperOrderItemId == null) select new { OrderItemId = orditem.Id, Amount = orditem.Amount == null ? "kein Preis" : (Math.Round(orditem.Amount, 2, MidpointRounding.AwayFromZero )).ToString(), ProductName = orditem.IsAuthorativeCharge ? orditem.ProductName + " (Amtl.Gebühr)" : orditem.ProductName, AmtGebuhr = authCharge == null ? false : true, //AmtGebuhr = orditem.IsAuthorativeCharge, AuthCharge=authCharge == null || authCharge.Amount == null ? "kein Preis" : (Math.Round(authCharge.Amount, 2, MidpointRounding.AwayFromZero )).ToString(), AuthChargeId = authCharge == null ? Guid.Empty : authCharge.Id, //AmtGebuhr2 = orditem.IsAuthorativeCharge ? "Ja" : "Nein" }; e.DetailTableView.DataSource = positionQuery; }
protected void RadGridAllOrders_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { var dbContext = new DataClasses1DataContext(); var item = (GridDataItem)e.DetailTableView.ParentItem; var orderNumber = Int32.Parse(item["OrderNumber"].Text); var positionQuery = from ord in dbContext.Order join orditem in dbContext.OrderItem on ord.OrderNumber equals orditem.OrderNumber let authCharge = dbContext.OrderItem.FirstOrDefault(s => s.SuperOrderItemId == orditem.Id) where ord.OrderNumber == orderNumber && (orditem.SuperOrderItemId == null) select new { OrderItemId = orditem.Id, Amount = orditem.Amount == null ? "kein Preis" : (Math.Round(orditem.Amount, 2, MidpointRounding.AwayFromZero)).ToString(), ProductName = orditem.IsAuthorativeCharge ? orditem.ProductName + " (Amtl.Gebühr)" : orditem.ProductName, AmtGebuhr = authCharge == null ? false : true, AuthCharge = authCharge == null || authCharge.Amount == null ? "kein Preis" : (Math.Round(authCharge.Amount, 2, MidpointRounding.AwayFromZero)).ToString(), AuthChargeId = authCharge == null ? (int?)null : authCharge.Id }; e.DetailTableView.DataSource = positionQuery; }
protected void RadGridNeuzulassung_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { DataClasses1DataContext dbContext = new DataClasses1DataContext(); GridDataItem item = (GridDataItem)e.DetailTableView.ParentItem; Guid orderId = new Guid(item["OrderId"].Text.ToString()); var positionQuery = from ord in dbContext.Order join orditem in dbContext.OrderItem on ord.Id equals orditem.OrderId let authCharge = dbContext.OrderItem.FirstOrDefault(s => s.SuperOrderItemId == orditem.Id) where ord.Id == orderId && (orditem.SuperOrderItemId == null) select new { OrderItemId = orditem.Id, Amount = orditem.Amount == null ? "kein Preis" : (Math.Round(orditem.Amount, 2, MidpointRounding.AwayFromZero)).ToString(), ProductName = orditem.IsAuthorativeCharge ? orditem.ProductName + " (Amtl.Gebühr)" : orditem.ProductName, AmtGebuhr = authCharge == null ? false : true, AuthCharge = authCharge == null || authCharge.Amount == null ? "kein Preis" : (Math.Round(authCharge.Amount, 2, MidpointRounding.AwayFromZero)).ToString(), AuthChargeId = authCharge == null ? Guid.Empty : authCharge.Id }; GridDataItem dataItem = item; GridNestedViewItem nestedItem = (GridNestedViewItem)dataItem.ChildItem; RadGrid radGrdEnquiriesVarients = (RadGrid)nestedItem.FindControl("RadGridNeuzulassungDetails"); radGrdEnquiriesVarients.DataSource = positionQuery; radGrdEnquiriesVarients.DataBind(); }