private void RefreshGrid(ASPxGridView gv) { GridViewDataComboBoxColumn c = (GridViewDataComboBoxColumn)gv.Columns["IdentifTecno"]; c.PropertiesComboBox.TextField = "Name"; c.PropertiesComboBox.ValueField = "IdentifTecno"; c.PropertiesComboBox.DataSource = Business.TecnologiaSoporte.ReadAll(""); gv.DataSource = Business.MediosPublicitarios.ReadAllTipo(""); gv.DataBind(); }
void InitDetailsAndPageHeader(ASPxGridView aspxGridView1) { ReadOnlyCollection<GridViewDataColumn> groupedColumns = aspxGridView1.GetGroupedColumns(); int pagewidth = (report.PageWidth - (report.Margins.Left + report.Margins.Right)) - groupedColumns.Count * subGroupOffset; List<ColumnInfo> columns = GetColumnsInfo(aspxGridView1, pagewidth); CustomizeColumnsCollection(report, new ColumnsCreationEventArgs(pagewidth) { ColumnsInfo = columns }); report.Bands.Add(new DetailBand() { HeightF = bandHeight }); report.Bands.Add(new PageHeaderBand() { HeightF = bandHeight }); XRTable headerTable = new XRTable(); XRTableRow row = new XRTableRow(); XRTable detailTable = new XRTable(); XRTableRow row2 = new XRTableRow(); for (int i = 0; i < columns.Count; i++) { if (columns[i].IsVisible) { XRTableCell cell = new XRTableCell(); cell.Width = columns[i].ColumnWidth; cell.Text = columns[i].FieldName; row.Cells.Add(cell); XRTableCell cell2 = new XRTableCell(); cell2.Width = columns[i].ColumnWidth; ControlCustomizationEventArgs cc = new ControlCustomizationEventArgs() { FieldName = columns[i].FieldName, IsModified = false, Owner = cell2 }; CustomizeColumn(report, cc); if (cc.IsModified == false) cell2.DataBindings.Add("Text", null, columns[i].FieldName); detailsInfo.Add(columns[i].GridViewColumn, cell2); row2.Cells.Add(cell2); } } headerTable.Rows.Add(row); headerTable.Width = pagewidth; headerTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0); headerTable.Borders = BorderSide.Bottom; detailTable.Rows.Add(row2); detailTable.LocationF = new PointF(groupedColumns.Count * subGroupOffset, 0); detailTable.Width = pagewidth; report.Bands[BandKind.PageHeader].Controls.Add(headerTable); report.Bands[BandKind.Detail].Controls.Add(detailTable); }
public static void MostrarResultadoOperacionBd(ref ASPxGridView grilla, string texto, bool resultado) { var color = COLOR_RESULTADO_MAL; if ((resultado)) color = COLOR_RESULTADO_BIEN; grilla.Controls.Add(new LiteralControl(string.Format("<span style='color:{0}; font-weight:bold; width:100%; text-align:center;'>{1}</span>", color, texto))); }
public static void GridApplyTheme(ASPxGridView Grid, string theTheme) { Grid.CssFilePath = "~/App_Themes/Glass/{0}/styles.css"; Grid.CssPostfix = "Glass"; Grid.Styles.CssFilePath = "~/App_Themes/Glass/{0}/styles.css"; Grid.Styles.CssPostfix = "Glass"; Grid.Styles.Header.SortingImageSpacing = 5; }
ASPxSplitter LayoutMasterDetail(Control detailControl, ASPxGridView gridView, IModelSplitLayout splitLayout) { ASPxSplitter splitter = CreateSplitter(splitLayout, PaneResized(gridView)); var listPane = CreateSplitterListPane(splitter); listPane.Controls.Add(gridView); var callbackPanel = CreateSplitterDetailPane(splitter); callbackPanel.Controls.Add(detailControl); return splitter; }
public void GridColDesign(ASPxGridView gridView, string fieldName, string Caption, int Width , int Index, bool isVisible) { GenerateGridParams GridSetup; GridSetup = new GenerateGridParams(fieldName); GridSetup.Caption = Caption; GridSetup.Width = Width; GridSetup.Visible = isVisible; GridSetup.Index = Index; gridView.cxGenerateGrid(GridSetup); }
public void DeleteFile(ASPxGridView gv, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { try{ string path = gv.GetRowValuesByKeyValue(e.Keys[0], "Path").ToString(); File.Delete(Server.MapPath(path)); } catch (Exception) { } }
/// <summary> /// Searchs for combo by FindEditFormTemplateControl and returns selected value /// </summary> /// <param name="grid"></param> /// <param name="controlName"></param> /// <returns></returns> public static object GetEditFormComboValue(ASPxGridView grid, string controlName) { ASPxComboBox cbo = (ASPxComboBox)grid.FindEditFormTemplateControl(controlName); if (cbo != null) if (cbo.SelectedItem == null) return null; else return cbo.SelectedItem.Value; return null; }
void ITemplate.InstantiateIn(Control container) { GridViewPagerBarTemplateContainer gridViewDataItemTemplateContainer = container as GridViewPagerBarTemplateContainer; if (gridViewDataItemTemplateContainer != null) { GridViewPagerBarTemplateContainer templateContainer = (GridViewPagerBarTemplateContainer)container; ASPxPager mypager = new ASPxPager(); grid = templateContainer.Grid; grid.SettingsPager.Summary.AllPagesText = "Trang {0}/{1} ({2} dòng dữ liệu)"; } }
public void GenerateGrid(ASPxGridView grid, GenerateGridParams generateGridParams) { //if (sender == null) return; //var grid = sender as ASPxGridView; //if (grid == null) return; //var grid = ((ASPxGridView)sender); var fieldname = grid.Columns[generateGridParams.FieldName]; fieldname.Visible = generateGridParams.Visible; fieldname.Width = generateGridParams.Width; fieldname.Caption = generateGridParams.Caption; fieldname.Index = generateGridParams.Index; }
public void SetupGridView(ASPxGridView gridView, Action OnFocusedObjectChanged) { _gridView = gridView; gridView.SettingsBehavior.AllowFocusedRow = true; gridView.Load += (s, e) => OnFocusedObjectChanged(); gridView.ClientSideEvents.Init = "function (s,e) { s.firstRowChangedAfterInit = true;}"; gridView.ClientSideEvents.FocusedRowChanged = @"function(s,e) { var up = window.DetailUpdatePanelControl; if (s.firstRowChangedAfterInit!==true && up && up.GetMainElement()) { up.PerformCallback(s.GetFocusedRowIndex());} s.firstRowChangedAfterInit = false; }"; gridView.Settings.VerticalScrollBarMode = ScrollBarMode.Visible; }
public void SetupGridView(ASPxGridView gridView, Action OnFocusedObjectChanged) { _gridView = gridView; gridView.SettingsBehavior.AllowFocusedRow = true; gridView.Load += (s, e) => OnFocusedObjectChanged(); gridView.ClientSideEvents.Init = "function (s,e) { s.firstRowChangedAfterInit = true;}"; gridView.ClientSideEvents.FocusedRowChanged = @"function(s,e) { var up = document.getElementById('DetailUpdatePanel'); if (s.firstRowChangedAfterInit!==true && up && up.ClientControl) { up.ClientControl.PerformCallback(s.GetFocusedRowIndex());} s.firstRowChangedAfterInit = false; }"; gridView.Settings.ShowVerticalScrollBar = true; }
public void SetupGridView(ASPxGridView gridView, Action OnFocusedObjectChanged) { _gridView = gridView; gridView.SettingsBehavior.AllowFocusedRow = true; gridView.Load += (s, e) => OnFocusedObjectChanged(); gridView.ClientSideEvents.Init = "function (s,e) { s.firstRowChangedAfterInit = true;}"; gridView.ClientSideEvents.FocusedRowChanged = @"function(s,e) { var parentSplitter = XpandHelper.GetParentControl(s); var up = XpandHelper.GetFirstChildControl(parentSplitter.GetPane(1).GetElement().childNodes[0]); if ((s.firstRowChangedAfterInit!==true || !XpandHelper.IsRootSplitter(parentSplitter)) && up && up.GetMainElement()) { up.PerformCallback(s.GetFocusedRowIndex());} s.firstRowChangedAfterInit = false; }"; gridView.Settings.VerticalScrollBarMode = ScrollBarMode.Visible; }
public bool ExibirBotao(ASPxGridView grid, int visibleIndex) { object row = grid.GetRow(visibleIndex); string arquivo = ""; if (visibleIndex != 0) { arquivo = grid.GetRowValues(visibleIndex, "ARQUIVO").ToString(); } if (string.IsNullOrEmpty(arquivo)) { return false; } else { return true; } }
/// <summary> /// Xử lý khi Save Callback kết thúc /// </summary> /// <param name="result">kết quả trả về khi callback xong</param> /// <param name="param">tham số e.Parameter của Callback Event</param> /// <param name="tblTemp">Tên bảng cần xóa dữ liệu tạm sau khi callback xong. Chỉ dành cho trường hợp lưu thành công</param> /// <param name="sessionname">Tên session lưu giữ sessionkey của bảng temp</param> /// public static void gridProductDetailsAddInCallback(string parameter, ASPxGridView gv) { object tempID = -1; if (parameter.StartsWith("reorderlevel")) { object typeReorder = parameter.Split(';')[1]; tempID = parameter.Split(';')[2]; if (tempID != null) { EU.SALE_temp_reorderLevel(tempID, typeReorder); //LogAction(4, tempID + ";ReorderLevel :" + parameter); //throw new Exception("gridProductDetailsAddInCallback;" + tempID + ";param:" + parameter); } } gv.DataBind(); }
private void CreateControlCheckBoxes() { if (string.IsNullOrEmpty(this.GridID)) throw new NullReferenceException("GridID property is null."); grid = NamingContainer.FindControl(GridID) as ASPxGridView; if (grid == null) throw new InvalidOperationException("ASPxGridView control was not found in NamingContainer."); foreach (GridViewDataColumn column in this.grid.Columns) { ASPxCheckBox columnCheckBox = new ASPxCheckBox(); columnCheckBox.ID = "chb" + column.VisibleIndex.ToString(); ASPxPopupControlDemo.Controls.Add(columnCheckBox); columnCheckBox.AutoPostBack = true; columnCheckBox.Text = column.Caption;//FieldName; columnCheckBox.Checked = column.Visible; columnCheckBox.CheckedChanged += new EventHandler(columnCheckBox_CheckedChanged); } }
public static void BindData(ASPxGridView gv, DevExpress.Xpo.Session s, string objectname, string filter = "", string DefaultSorting="", params object[] parameter) { try { DynamicDataTableClassInfo classInfo = dynamicClasses[objectname]; if (classInfo != null) { XPServerCollectionSource ds = new XPServerCollectionSource(s, dynamicClasses[objectname], CriteriaOperator.Parse(filter, parameter)); ds.DefaultSorting = DefaultSorting; gv.DataSource = ds; //gv.KeyFieldName = classInfo.KeyProperty.DisplayName; } else throw new Exception(string.Format("Đối tượng {0} không tìm thấy trong database. Nếu không có dữ liệu hiển thị thì XPOProfiles để xem điều kiện lọc đúng chưa", objectname)); } catch (Exception ex) { SiAuto.Main.LogColored(Color.Red, "Loi BindData:" + ex.ToString()); throw ex; } }
protected void GridListagem_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; // string ID = ""; string apelido = ""; string nome = ""; string sexo = ""; string cnpj = ""; string inscmunicipal = ""; string inscestadual = ""; string regjuntacom = ""; string nire = ""; string rg = ""; string rguf = ""; string rgemissor = ""; DateTime rgemissao = Convert.ToDateTime("01/01/1900"); string endereco = ""; string enderecores = ""; string enderecoresnumero = ""; string enderecorescomplem = ""; string bairrores = ""; string cidaderes = ""; string ufres = ""; string cepres = ""; string fone1res = ""; string fone2res = ""; string fone3res = ""; string enderecocom = ""; string enderecocomnumero = ""; string enderecocomcomplem = ""; string bairrocom = ""; string cidadecom = ""; string ufcom = ""; string cepcom = ""; string fone1com = ""; string fone2com = ""; string fone3com = ""; string email1 = ""; string email2 = ""; string email3 = ""; string email4 = ""; string email5 = ""; string gerente = ""; string contato = ""; DateTime dtnascimento = Convert.ToDateTime("01/01/1900"); DateTime dtingresso = Convert.ToDateTime("01/01/1900"); string ncontrato = ""; DateTime dtcontrato = Convert.ToDateTime("01/01/1900"); Boolean ativo = true; Boolean acessointernet = true; string empregador = ""; string cargo = ""; string atividade = ""; string obs1 = ""; string obs2 = ""; string obs3 = ""; string obs4 = ""; string obs5 = ""; string conjugenome = ""; string conjugesexo = ""; string conjugecnpj = ""; string conjugerg = ""; string conjugerguf = ""; string conjugergemissor = ""; DateTime conjugergemissao = Convert.ToDateTime("01/01/1900"); DateTime dtnascimentoconjuge = Convert.ToDateTime("01/01/1900"); string fone1con = ""; string fone2con = ""; string fone3con = ""; string conjugeemail1 = ""; string conjugeemail2 = ""; string instrcob1 = ""; string instrcob2 = ""; string diasprotesto = ""; string conta1 = ""; string conta2 = ""; string conta3 = ""; string conta4 = ""; string conta5 = ""; Boolean dda = false; // // Empresa ID = e.NewValues["ID"].ToString(); apelido = e.NewValues["apelido"].ToString(); nome = e.NewValues["nome"].ToString(); sexo = e.NewValues["sexo"].ToString(); cnpj = e.NewValues["cnpj"].ToString(); if (e.NewValues["inscmunicipal"] != null) { inscmunicipal = e.NewValues["inscmunicipal"].ToString(); } if (e.NewValues["inscestadual"] != null) { inscestadual = e.NewValues["inscestadual"].ToString(); } if (e.NewValues["regjuntacom"] != null) { regjuntacom = e.NewValues["regjuntacom"].ToString(); } if (e.NewValues["nire"] != null) { nire = e.NewValues["nire"].ToString(); } if (e.NewValues["rg"] != null) { rg = e.NewValues["rg"].ToString(); } if (e.NewValues["rguf"] != null) { rguf = e.NewValues["rguf"].ToString(); } if (e.NewValues["rgemissor"] != null) { rgemissor = e.NewValues["rgemissor"].ToString(); } if (e.NewValues["rgemissao"] != null) { rgemissao = Convert.ToDateTime(e.NewValues["rgemissao"].ToString()); } if (e.NewValues["endereco"] != null) { endereco = e.NewValues["endereco"].ToString(); } if (e.NewValues["enderecores"] != null) { enderecores = e.NewValues["enderecores"].ToString(); } if (e.NewValues["enderecoresnumero"] != null) { enderecoresnumero = e.NewValues["enderecoresnumero"].ToString(); } if (e.NewValues["enderecorescomplem"] != null) { enderecorescomplem = e.NewValues["enderecorescomplem"].ToString(); } if (e.NewValues["bairrores"] != null) { bairrores = e.NewValues["bairrores"].ToString(); } if (e.NewValues["cidaderes"] != null) { cidaderes = e.NewValues["cidaderes"].ToString(); } if (e.NewValues["ufres"] != null) { ufres = e.NewValues["ufres"].ToString(); } if (e.NewValues["cepres"] != null) { cepres = e.NewValues["cepres"].ToString(); } if (e.NewValues["fone1res"] != null) { fone1res = e.NewValues["fone1res"].ToString(); } if (e.NewValues["fone2res"] != null) { fone2res = e.NewValues["fone2res"].ToString(); } if (e.NewValues["fone3res"] != null) { fone3res = e.NewValues["fone3res"].ToString(); } if (e.NewValues["enderecocom"] != null) { enderecocom = e.NewValues["enderecocom"].ToString(); } if (e.NewValues["enderecocomnumero"] != null) { enderecocomnumero = e.NewValues["enderecocomnumero"].ToString(); } if (e.NewValues["enderecocomcomplem"] != null) { enderecocomcomplem = e.NewValues["enderecocomcomplem"].ToString(); } if (e.NewValues["bairrocom"] != null) { bairrocom = e.NewValues["bairrocom"].ToString(); } if (e.NewValues["cidadecom"] != null) { cidadecom = e.NewValues["cidadecom"].ToString(); } if (e.NewValues["ufcom"] != null) { ufcom = e.NewValues["ufcom"].ToString(); } if (e.NewValues["cepcom"] != null) { cepcom = e.NewValues["cepcom"].ToString(); } if (e.NewValues["fone1com"] != null) { fone1com = e.NewValues["fone1com"].ToString(); } if (e.NewValues["fone2com"] != null) { fone2com = e.NewValues["fone2com"].ToString(); } if (e.NewValues["fone3com"] != null) { fone3com = e.NewValues["fone3com"].ToString(); } if (e.NewValues["email1"] != null) { email1 = e.NewValues["email1"].ToString(); } if (e.NewValues["email2"] != null) { email2 = e.NewValues["email2"].ToString(); } if (e.NewValues["email3"] != null) { email3 = e.NewValues["email3"].ToString(); } if (e.NewValues["email4"] != null) { email4 = e.NewValues["email4"].ToString(); } if (e.NewValues["email5"] != null) { email5 = e.NewValues["email5"].ToString(); } if (e.NewValues["gerente"] != null) { gerente = e.NewValues["gerente"].ToString(); } if (e.NewValues["contato"] != null) { contato = e.NewValues["contato"].ToString(); } if (e.NewValues["dtnascimento"] != null) { dtnascimento = Convert.ToDateTime(e.NewValues["dtnascimento"].ToString()); } if (e.NewValues["dtingresso"] != null) { dtingresso = Convert.ToDateTime(e.NewValues["dtingresso"].ToString()); } if (e.NewValues["ncontrato"] != null) { ncontrato = e.NewValues["ncontrato"].ToString(); } if (e.NewValues["dtcontrato"] != null) { dtcontrato = Convert.ToDateTime(e.NewValues["dtcontrato"].ToString()); } if (e.NewValues["ativo"] != null) { ativo = Convert.ToBoolean(e.NewValues["ativo"].ToString()); } if (e.NewValues["acessointernet"] != null) { acessointernet = Convert.ToBoolean(e.NewValues["acessointernet"].ToString()); } if (e.NewValues["empregador"] != null) { empregador = e.NewValues["empregador"].ToString(); } if (e.NewValues["cargo"] != null) { cargo = e.NewValues["cargo"].ToString(); } if (e.NewValues["atividade"] != null) { atividade = e.NewValues["atividade"].ToString(); } if (e.NewValues["obs1"] != null) { obs1 = e.NewValues["obs1"].ToString(); } if (e.NewValues["obs2"] != null) { obs2 = e.NewValues["obs2"].ToString(); } if (e.NewValues["obs3"] != null) { obs3 = e.NewValues["obs3"].ToString(); } if (e.NewValues["obs4"] != null) { obs4 = e.NewValues["obs4"].ToString(); } if (e.NewValues["obs5"] != null) { obs5 = e.NewValues["obs5"].ToString(); } if (e.NewValues["conjugenome"] != null) { conjugenome = e.NewValues["conjugenome"].ToString(); } if (e.NewValues["conjugesexo"] != null) { conjugesexo = e.NewValues["conjugesexo"].ToString(); } if (e.NewValues["conjugecnpj"] != null) { conjugecnpj = e.NewValues["conjugecnpj"].ToString(); } if (e.NewValues["conjugerg"] != null) { conjugerg = e.NewValues["rg"].ToString(); } if (e.NewValues["conjugerguf"] != null) { conjugerguf = e.NewValues["conjugerguf"].ToString(); } if (e.NewValues["conjugergemissor"] != null) { conjugergemissor = e.NewValues["conjugergemissor"].ToString(); } if (e.NewValues["conjugergemissao"] != null) { conjugergemissao = Convert.ToDateTime(e.NewValues["conjugergemissao"].ToString()); } if (e.NewValues["dtnascimentoconjuge"] != null) { dtnascimentoconjuge = Convert.ToDateTime(e.NewValues["dtnascimentoconjuge"].ToString()); } if (e.NewValues["fone1con"] != null) { fone1con = e.NewValues["fone1con"].ToString(); } if (e.NewValues["fone2con"] != null) { fone2con = e.NewValues["fone2con"].ToString(); } if (e.NewValues["fone3con"] != null) { fone3con = e.NewValues["fone3con"].ToString(); } if (e.NewValues["conjugeemail1"] != null) { conjugeemail1 = e.NewValues["conjugeemail1"].ToString(); } if (e.NewValues["conjugeemail2"] != null) { conjugeemail2 = e.NewValues["conjugeemail2"].ToString(); } if (e.NewValues["instrcob1"] != null) { instrcob1 = e.NewValues["instrcob1"].ToString(); } if (e.NewValues["instrcob2"] != null) { instrcob2 = e.NewValues["instrcob2"].ToString(); } if (e.NewValues["diasprotesto"] != null) { diasprotesto = e.NewValues["diasprotesto"].ToString(); } if (e.NewValues["conta1"] != null) { conta1 = e.NewValues["conta1"].ToString(); } if (e.NewValues["conta2"] != null) { conta2 = e.NewValues["conta2"].ToString(); } if (e.NewValues["conta3"] != null) { conta3 = e.NewValues["conta3"].ToString(); } if (e.NewValues["conta4"] != null) { conta4 = e.NewValues["conta4"].ToString(); } if (e.NewValues["conta5"] != null) { conta5 = e.NewValues["conta5"].ToString(); } if (e.NewValues["dda"] != null) { dda = Convert.ToBoolean(e.NewValues["dda"].ToString()); } uContato.Altera(ID, apelido, nome, sexo, cnpj, inscmunicipal, inscestadual, regjuntacom, nire, rg, rguf, rgemissor, rgemissao, endereco, enderecores, enderecoresnumero, enderecorescomplem, bairrores, cidaderes, ufres, cepres, fone1res, fone2res, fone3res, enderecocom, enderecocomnumero, enderecocomcomplem, bairrocom, cidadecom, ufcom, cepcom, fone1com, fone2com, fone3com, email1, email2, email3, email4, email5, gerente, contato, dtnascimento, dtingresso, ncontrato, dtcontrato, ativo, acessointernet, empregador, cargo, atividade, conjugenome, conjugesexo, conjugecnpj, conjugerg, conjugerguf, conjugergemissor, conjugergemissao, dtnascimentoconjuge, fone1con, fone2con, fone3con, conjugeemail1, conjugeemail2, obs1, obs2, obs3, obs4, obs5, instrcob1, instrcob2, diasprotesto, conta1, conta2, conta3, conta4, conta5, dda); gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "ALTERA CONTATO: " + ID + "/" + cnpj + "/" + apelido; SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "CONTATO"), new SqlParameter("@obs", "ALTERA"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); // AtualizaGrid(); }
protected void gvMain_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { SetMandatory(); ASPxGridView gv = (ASPxGridView)sender; string[] commands = e.Parameters.Split('='); string command = commands[0]; if (command == "1" || command == "2" || command == "3") { string value1 = "0"; //OEMID string value2 = "0"; //TechID if (command == "1") //OEM changed { value1 = commands[1]; if (Session["NewTech"] != null) { value2 = Session["NewTech"].ToString(); } Session["NewOEM"] = value1; } if (command == "2") //Tech changed { value1 = Session["NewOEM"].ToString(); value2 = commands[1]; Session["NewTech"] = value2; if (Session["NewTech"].ToString() == "null") { Session["NewTech"] = null; } } if (command == "3") //Network Element changed { value1 = Session["NewOEM"].ToString(); if (Session["NewTech"] != null) { value2 = Session["NewTech"].ToString(); } else { value2 = "null"; } Session["NewNetwork"] = commands[1]; if (Session["NewNetwork"].ToString() == "null") { Session["NewNetwork"] = null; } } ASPxComboBox cb1 = gv.FindEditRowCellTemplateControl(gv.Columns["TechnologyID"] as GridViewDataColumn, "cbTech") as ASPxComboBox; ASPxComboBox cb2 = gv.FindEditRowCellTemplateControl(gv.Columns["NetworkElementID"] as GridViewDataColumn, "cbNetwork") as ASPxComboBox; string sql = "SELECT ID, NAME FROM tblTechnology WHERE OEMID = " + value1; DataTable dt = DataBase.GetDT(sql); cb1.DataSource = dt; cb1.DataBind(); if (command == "1" || value2 == null) { cb1.SelectedIndex = -1; Session["NewTech"] = null; cb2.Items.Clear(); cb2.SelectedIndex = -1; Session["NewNetwork"] = null; } else if (command == "2") { cb1.SelectedIndex = cb1.Items.FindByValue(value2).Index; sql = "SELECT ID, NAME FROM tblNetworkElement WHERE TechID = " + value2; dt = DataBase.GetDT(sql); cb2.DataSource = dt; cb2.DataBind(); cb2.SelectedIndex = -1; Session["NewNetwork"] = null; } else if (command == "3") { sql = "SELECT ID, NAME FROM tblNetworkElement WHERE TechID = " + value2; dt = DataBase.GetDT(sql); cb2.DataSource = dt; cb2.DataBind(); if (Session["NewNetwork"] == null) { cb2.SelectedIndex = -1; } else { cb2.SelectedIndex = cb2.Items.FindByValue(Session["NewNetwork"].ToString()).Index; } } } if (command == "4") { string value4 = commands[1]; ASPxTextBox tb = gv.FindEditRowCellTemplateControl(gv.Columns["ControllerIP"] as GridViewDataColumn, "tbControllerIP") as ASPxTextBox; string sql = "SELECT IPAddress FROM tblController WHERE ID = " + value4; DataTable dt = DataBase.GetDT(sql); tb.Text = dt.Rows[0][0].ToString(); } }
protected void detailGrid_DataSelect(object sender, EventArgs e) { ASPxGridView detailGrid = sender as ASPxGridView; detailGrid.DataSource = DataProvider.GetItems((int)detailGrid.GetMasterRowKeyValue()); }
protected void GridListagem_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; uContasPagar.Exclui(e.Values["ID"].ToString()); // gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "EXCLUI CONTAS A PAGAR: " + e.Values["ID"].ToString() + "/" + e.Values["lancamento"].ToString().ToUpper(); SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "CONTAS A PAGAR"), new SqlParameter("@obs", "EXCLUI"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); //Todas if (rbparcelasituacao.SelectedIndex == 0) { //Todas/Lançamento if (rbordenacao.SelectedIndex == 0) { GridListagem.Visible = true; AtualizaGrid("T", "L"); } //Todas/Classe Despesa if (rbordenacao.SelectedIndex == 1) { GridListagem.Visible = true; AtualizaGrid("T", "D"); } //Todas/Fornecedores if (rbordenacao.SelectedIndex == 2) { GridListagem.Visible = true; AtualizaGrid("T", "F"); } //Todas/Data Prevista if (rbordenacao.SelectedIndex == 3) { GridListagem.Visible = true; AtualizaGrid("T", "DP"); } //Todas/Data Realizado if (rbordenacao.SelectedIndex == 4) { GridListagem.Visible = true; AtualizaGrid("T", "DR"); } //Todas/Data Nota Fiscal if (rbordenacao.SelectedIndex == 5) { GridListagem.Visible = true; AtualizaGrid("T", "DN"); } } //Previsto if (rbparcelasituacao.SelectedIndex == 1) { //Previsto/Lançamento if (rbordenacao.SelectedIndex == 0) { GridListagem.Visible = true; AtualizaGrid("P", "L"); } //Previsto/Classe Despesa if (rbordenacao.SelectedIndex == 1) { GridListagem.Visible = true; AtualizaGrid("P", "D"); } //Previsto/Fornecedores if (rbordenacao.SelectedIndex == 2) { GridListagem.Visible = true; AtualizaGrid("P", "F"); } //Previsto/Data Prevista if (rbordenacao.SelectedIndex == 3) { GridListagem.Visible = true; AtualizaGrid("P", "DP"); } //Previsto/Data Realizado if (rbordenacao.SelectedIndex == 4) { GridListagem.Visible = true; AtualizaGrid("P", "DR"); } //Previsto/Data Nota Fiscal if (rbordenacao.SelectedIndex == 5) { GridListagem.Visible = true; AtualizaGrid("P", "DN"); } } //Realizado if (rbparcelasituacao.SelectedIndex == 2) { //Realizado/Lançamento if (rbordenacao.SelectedIndex == 0) { GridListagem.Visible = true; AtualizaGrid("R", "L"); } //Realizado/Classe Despesa if (rbordenacao.SelectedIndex == 1) { GridListagem.Visible = true; AtualizaGrid("R", "D"); } //Realizado/Fornecedores if (rbordenacao.SelectedIndex == 2) { GridListagem.Visible = true; AtualizaGrid("R", "F"); } //Realizado/Data Prevista if (rbordenacao.SelectedIndex == 3) { GridListagem.Visible = true; AtualizaGrid("R", "DP"); } //Realizado/Data Realizado if (rbordenacao.SelectedIndex == 4) { GridListagem.Visible = true; AtualizaGrid("R", "DR"); } //Realizado/Data Nota Fiscal if (rbordenacao.SelectedIndex == 5) { GridListagem.Visible = true; AtualizaGrid("R", "DN"); } } }
internal XtraReport GenerateReport(ASPxGridView ASPxGridView1, ObjectDataSource ObjectDataSource1) { report = new XtraReport(); report.Landscape = true; report.PaperKind = System.Drawing.Printing.PaperKind.Letter; //InitDataSource(ObjectDataSource1); DataView dv = new DataView(); DataTable dt = new DataTable(); dv = ObjectDataSource1.Select() as DataView; //.Select(DataSourceSelectArguments.Empty) as DataView; dt = dv.ToTable(); report.DataSource = dt; InitDetailsAndPageHeader(ASPxGridView1); InitSortings(ASPxGridView1); InitGroupHeaders(ASPxGridView1); InitFilters(ASPxGridView1); InitTotalSummaries(ASPxGridView1); return report; }
/// <summary> /// GridView的直接子控件的显示情况(GridView.Column可填Caption/FieldName) /// </summary> /// <param name="gv"></param> /// <param name="Status"></param> public static void Bind_Authority(ASPxGridView gv, string Status) { Bind_Authority(gv, Status, ""); }
protected void gvA_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; var selected_keys = gvA.GetSelectedFieldValues("ActionID"); ASPxCheckBox chkAllSelected = gv.FindEditFormLayoutItemTemplateControl("chkUpdateAllSelected") as ASPxCheckBox; bool updateALLSelected = chkAllSelected.Checked; List <int> pkvals = new List <int>(); foreach (object key in e.Keys.Values) { int ikey; bool isint = int.TryParse(key.ToString(), out ikey); if (isint) { pkvals.Add(ikey); } } //Add the other selected rows to the update if the user has selected the "Update All" checkbox if (selected_keys.Count > 0 && updateALLSelected) { foreach (object k in selected_keys) { int ikey; bool isint = int.TryParse(k.ToString(), out ikey); if (!pkvals.Contains(ikey)) { pkvals.Add(ikey); } } } ////Get the data from the ComboBoxes //ASPxComboBox cboMS = (ASPxComboBox)gvM.FindEditFormLayoutItemTemplateControl( "CboMS"); //ASPxComboBox cboMSD = (ASPxComboBox)gvM.FindEditFormLayoutItemTemplateControl( "CboMSD"); //e.NewValues["MeasStatusID"] = cboMS.Value; //e.NewValues["MeasStatusDetailID"] = cboMSD.Value; //ASPxMemo notes = (ASPxMemo)gvM.FindEditFormLayoutItemTemplateControl("notesEditor"); //e.NewValues["Notes"] = notes.Value; ////string result = dxGrid_UpdateData(e.Keys, e.NewValues, "backend", "dbo", "tblStudyMeasSubj"); //string result = dataops.dxGrid_UpdateData("studymeassubjID", pkvals, e.NewValues, "backend", "dbo", "tblStudyMeasSubj"); popupdata.AddField(e.NewValues, gvA, "ActionStatusID", "CboAS", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvA, "DateDone", "DateCalendarA", DevExpress.Web.ControlType.ASPxDateEdit); //popupdata.AddField(e.NewValues, gvA, "Clinician", "CboClinA", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvA, "Notes", "notesEditorA", DevExpress.Web.ControlType.ASPxMemo); string result = dataops.dxGrid_UpdateData("actionID", pkvals, e.NewValues, "backend", "dbo", "tblAction"); gvAstatus.Text = result; //gvM.JSProperties["gvM_IsUpdated"] = true; gv.CancelEdit(); e.Cancel = true; gvA.DataBind(); }
protected void gvM_OnRowUpdating(object sender, ASPxDataUpdatingEventArgs e) { ASPxGridView gv = (ASPxGridView)sender; var selected_keys = gvM.GetSelectedFieldValues("StudyMeasSubjID"); ASPxCheckBox chkAllSelected = gv.FindEditFormLayoutItemTemplateControl("chkUpdateAllSelected") as ASPxCheckBox; bool updateALLSelected = chkAllSelected.Checked; List <int> pkvals = new List <int>(); foreach (object key in e.Keys.Values) { int ikey; bool isint = int.TryParse(key.ToString(), out ikey); if (isint) { pkvals.Add(ikey); } } //Add the other selected rows to the update if the user has selected the "Update All" checkbox if (selected_keys.Count > 0 && updateALLSelected) { foreach (object k in selected_keys) { int ikey; bool isint = int.TryParse(k.ToString(), out ikey); if (!pkvals.Contains(ikey)) { pkvals.Add(ikey); } } } popupdata.AddField(e.NewValues, gvM, "MeasStatusID", "CboMS", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvM, "MeasStatusDetailID", "CboMSD", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvM, "Date", "DateCalendar", DevExpress.Web.ControlType.ASPxDateEdit); popupdata.AddField(e.NewValues, gvM, "Clinician", "CboClin", DevExpress.Web.ControlType.ASPxComboBox); popupdata.AddField(e.NewValues, gvM, "Notes", "notesEditor", DevExpress.Web.ControlType.ASPxMemo); ASPxRadioButtonList rblDate = gv.FindEditFormLayoutItemTemplateControl("rblDate") as ASPxRadioButtonList; if (rblDate.Value != null) { //remove the entered date as we will programmatically assign a different date e.NewValues.Remove("Date"); //Update the date based on the selected mode string mode = rblDate.Value.ToString(); string date_update = dataops.dxGrid_Update_StudyMeasSubj_Dates(mode, pkvals); } string result = dataops.dxGrid_UpdateData("studymeassubjID", pkvals, e.NewValues, "backend", "dbo", "tblStudyMeasSubj"); gvMstatus.Text = result; //gvM.JSProperties["gvM_IsUpdated"] = true; gv.CancelEdit(); e.Cancel = true; //GetMeasureInfo(ID); gvM.DataBind(); }
protected void grid_Init(object sender, EventArgs e) { ASPxGridView g = sender as ASPxGridView; g.Visible = g.IsCallback; }
private LayoutItemBase GetEditFormLayoutItemByName(ASPxGridView grid, string name) { return(grid.EditFormLayoutProperties.FindItemOrGroupByName(name)); }
protected void gridRepository_BeforePerformDataSelect(object sender, EventArgs e) { ASPxGridView gridRepository = (ASPxGridView)sender; gridRepository.DataSource = rc_services.GetRepository("P", false); }
protected void GridListagem_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; // string ID = ""; string apelido = ""; string nome = ""; string sexo = ""; string cnpj = ""; string inscmunicipal = ""; string inscestadual = ""; string regjuntacom = ""; string nire = ""; string rg = ""; string rguf = ""; string rgemissor = ""; DateTime rgemissao = Convert.ToDateTime("01/01/1900"); string endereco = ""; string enderecores = ""; string enderecoresnumero = ""; string enderecorescomplem = ""; string bairrores = ""; string cidaderes = ""; string ufres = ""; string cepres = ""; string fone1res = ""; string fone2res = ""; string fone3res = ""; string enderecocom = ""; string enderecocomnumero = ""; string enderecocomcomplem = ""; string bairrocom = ""; string cidadecom = ""; string ufcom = ""; string cepcom = ""; string fone1com = ""; string fone2com = ""; string fone3com = ""; string email1 = ""; string email2 = ""; string email3 = ""; string email4 = ""; string email5 = ""; string gerente = ""; string contato = ""; DateTime dtnascimento = Convert.ToDateTime("01/01/1900"); DateTime dtingresso = Convert.ToDateTime("01/01/1900"); string ncontrato = ""; DateTime dtcontrato = Convert.ToDateTime("01/01/1900"); Boolean ativo = true; Boolean acessointernet = true; string empregador = ""; string cargo = ""; string atividade = ""; string obs1 = ""; string obs2 = ""; string obs3 = ""; string obs4 = ""; string obs5 = ""; string conjugenome = ""; string conjugesexo = ""; string conjugecnpj = ""; string conjugerg = ""; string conjugerguf = ""; string conjugergemissor = ""; DateTime conjugergemissao = Convert.ToDateTime("01/01/1900"); DateTime dtnascimentoconjuge = Convert.ToDateTime("01/01/1900"); string fone1con = ""; string fone2con = ""; string fone3con = ""; string conjugeemail1 = ""; string conjugeemail2 = ""; string instrcob1 = ""; string instrcob2 = ""; string diasprotesto = ""; string conta1 = ""; string conta2 = ""; string conta3 = ""; string conta4 = ""; string conta5 = ""; Boolean dda = false; // // Empresa ID = uContato.ProximoID(); apelido = e.NewValues["apelido"].ToString().ToUpper(); nome = e.NewValues["nome"].ToString().ToUpper(); sexo = e.NewValues["sexo"].ToString().ToUpper(); cnpj = e.NewValues["cnpj"].ToString(); if (e.NewValues["inscmunicipal"] != null) { inscmunicipal = e.NewValues["inscmunicipal"].ToString(); } if (e.NewValues["inscestadual"] != null) { inscestadual = e.NewValues["inscestadual"].ToString(); } if (e.NewValues["regjuntacom"] != null) { regjuntacom = e.NewValues["regjuntacom"].ToString(); } if (e.NewValues["nire"] != null) { nire = e.NewValues["nire"].ToString(); } if (e.NewValues["rg"] != null) { rg = e.NewValues["rg"].ToString(); } if (e.NewValues["rguf"] != null) { rguf = e.NewValues["rguf"].ToString(); } if (e.NewValues["rgemissor"] != null) { rgemissor = e.NewValues["rgemissor"].ToString(); } if (e.NewValues["rgemissao"] != null) { rgemissao = Convert.ToDateTime(e.NewValues["rgemissao"].ToString()); } if (e.NewValues["endereco"] != null) { endereco = e.NewValues["endereco"].ToString(); } // if (e.NewValues["enderecores"] != null) { enderecores = e.NewValues["enderecores"].ToString(); } if (e.NewValues["enderecoresnumero"] != null) { enderecoresnumero = e.NewValues["enderecoresnumero"].ToString(); } if (e.NewValues["enderecorescomplem"] != null) { enderecorescomplem = e.NewValues["enderecorescomplem"].ToString(); } if (e.NewValues["bairrores"] != null) { bairrores = e.NewValues["bairrores"].ToString(); } if (e.NewValues["cidaderes"] != null) { cidaderes = e.NewValues["cidaderes"].ToString(); } if (e.NewValues["ufres"] != null) { ufres = e.NewValues["ufres"].ToString(); } if (e.NewValues["cepres"] != null) { cepres = e.NewValues["cepres"].ToString(); } if (e.NewValues["fone1res"] != null) { fone1res = e.NewValues["fone1res"].ToString(); } if (e.NewValues["fone2res"] != null) { fone2res = e.NewValues["fone2res"].ToString(); } if (e.NewValues["fone3res"] != null) { fone3res = e.NewValues["fone3res"].ToString(); } // if (e.NewValues["enderecocom"] != null) { enderecocom = e.NewValues["enderecocom"].ToString(); } if (e.NewValues["enderecocomnumero"] != null) { enderecocomnumero = e.NewValues["enderecocomnumero"].ToString(); } if (e.NewValues["enderecocomcomplem"] != null) { enderecocomcomplem = e.NewValues["enderecocomcomplem"].ToString(); } if (e.NewValues["bairrocom"] != null) { bairrocom = e.NewValues["bairrocom"].ToString(); } if (e.NewValues["cidadecom"] != null) { cidadecom = e.NewValues["cidadecom"].ToString(); } if (e.NewValues["ufcom"] != null) { ufcom = e.NewValues["ufcom"].ToString(); } if (e.NewValues["cepcom"] != null) { cepcom = e.NewValues["cepcom"].ToString(); } if (e.NewValues["fone1com"] != null) { fone1com = e.NewValues["fone1com"].ToString(); } if (e.NewValues["fone2com"] != null) { fone2com = e.NewValues["fone2com"].ToString(); } if (e.NewValues["fone3com"] != null) { fone3com = e.NewValues["fone3com"].ToString(); } // if (e.NewValues["email1"] != null) { email1 = e.NewValues["email1"].ToString(); } if (e.NewValues["email2"] != null) { email2 = e.NewValues["email2"].ToString(); } if (e.NewValues["email3"] != null) { email3 = e.NewValues["email3"].ToString(); } if (e.NewValues["email4"] != null) { email4 = e.NewValues["email4"].ToString(); } if (e.NewValues["email5"] != null) { email5 = e.NewValues["email5"].ToString(); } if (e.NewValues["gerente"] != null) { gerente = e.NewValues["gerente"].ToString().ToUpper(); } if (e.NewValues["contato"] != null) { contato = e.NewValues["contato"].ToString().ToUpper(); } if (e.NewValues["dtnascimento"] != null) { dtnascimento = Convert.ToDateTime(e.NewValues["dtnascimento"].ToString()); } if (e.NewValues["dtingresso"] != null) { dtingresso = Convert.ToDateTime(e.NewValues["dtingresso"].ToString()); } if (e.NewValues["ncontrato"] != null) { ncontrato = e.NewValues["ncontrato"].ToString(); } if (e.NewValues["dtcontrato"] != null) { dtcontrato = Convert.ToDateTime(e.NewValues["dtcontrato"].ToString()); } if (e.NewValues["ativo"] != null) { ativo = Convert.ToBoolean(e.NewValues["ativo"].ToString()); } if (e.NewValues["acessointernet"] != null) { acessointernet = Convert.ToBoolean(e.NewValues["acessointernet"].ToString()); } // if (e.NewValues["empregador"] != null) { empregador = e.NewValues["empregador"].ToString(); } if (e.NewValues["cargo"] != null) { cargo = e.NewValues["cargo"].ToString(); } if (e.NewValues["atividade"] != null) { atividade = e.NewValues["atividade"].ToString(); } // if (e.NewValues["obs1"] != null) { obs1 = e.NewValues["obs1"].ToString(); } if (e.NewValues["obs2"] != null) { obs2 = e.NewValues["obs2"].ToString(); } if (e.NewValues["obs3"] != null) { obs3 = e.NewValues["obs3"].ToString(); } if (e.NewValues["obs4"] != null) { obs4 = e.NewValues["obs4"].ToString(); } if (e.NewValues["obs5"] != null) { obs5 = e.NewValues["obs5"].ToString(); } if (e.NewValues["instrcob1"] != null) { instrcob1 = e.NewValues["instrcob1"].ToString(); } if (e.NewValues["instrcob2"] != null) { instrcob2 = e.NewValues["instrcob2"].ToString(); } if (e.NewValues["diasprotesto"] != null) { diasprotesto = e.NewValues["diasprotesto"].ToString(); } if (e.NewValues["conta1"] != null) { conta1 = e.NewValues["conta1"].ToString(); } if (e.NewValues["conta2"] != null) { conta2 = e.NewValues["conta2"].ToString(); } if (e.NewValues["conta3"] != null) { conta3 = e.NewValues["conta3"].ToString(); } if (e.NewValues["conta4"] != null) { conta4 = e.NewValues["conta4"].ToString(); } if (e.NewValues["conta5"] != null) { conta5 = e.NewValues["conta5"].ToString(); } if (e.NewValues["dda"] != null) { dda = Convert.ToBoolean(e.NewValues["dda"].ToString()); } if (uContato.PesquisaCpfCnpj(cnpj).Trim() == "") { uContato.Grava(ID, apelido, nome, sexo, cnpj, inscmunicipal, inscestadual, regjuntacom, nire, rg, rguf, rgemissor, rgemissao, endereco, enderecores, enderecoresnumero, enderecorescomplem, bairrores, cidaderes, ufres, cepres, fone1res, fone2res, fone3res, enderecocom, enderecocomnumero, enderecocomcomplem, bairrocom, cidadecom, ufcom, cepcom, fone1com, fone2com, fone3com, email1, email2, email3, email4, email5, gerente, contato, dtnascimento, dtingresso, ncontrato, dtcontrato, ativo, acessointernet, empregador, cargo, atividade, conjugenome, conjugesexo, conjugecnpj, conjugerg, conjugerguf, conjugergemissor, conjugergemissao, dtnascimentoconjuge, fone1con, fone2con, fone3con, conjugeemail1, conjugeemail2, obs1, obs2, obs3, obs4, obs5, instrcob1, instrcob2, diasprotesto, conta1, conta2, conta3, conta4, conta5, dda); gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "INCLUI CONTATO: NOVO/" + cnpj + "/" + apelido; SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "CONTATO"), new SqlParameter("@obs", "INCLUI"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); // AtualizaGrid(); // } else { //ScriptManager.RegisterStartupScript(UpdatePanel, GetType(), "msgbox", "alert('CPF/CNPJ ja existe no Cadastro!');", true); ScriptManager.RegisterStartupScript(this.Page, typeof(Page), Guid.NewGuid().ToString(), "toastr.error('CPF/CNPJ ja existe no Cadastro!', 'Atenção!')", true); } }
string PaneResized(ASPxGridView gridView) { return string.Format(CultureInfo.InvariantCulture, "function (s,e) {{ if (e.pane.name==='listPane') {{ {0}.SetWidth(e.pane.GetClientWidth()); {0}.SetHeight(e.pane.GetClientHeight());}}}}", gridView.ClientInstanceName); }
void SetupViewItems(ASPxGridView gridView) { if (string.IsNullOrEmpty(gridView.ClientInstanceName)) gridView.ClientInstanceName = "gridViewInSplitter"; }
/// <summary> /// GridView的直接子控件的显示情况(GridView.Column可填Caption/FieldName) /// </summary> /// <param name="gv"></param> public static void Bind_Authority(ASPxGridView gv) { Bind_Authority(gv, "", ""); }
List<GridViewDataColumn> GetVisibleDataColumns(ASPxGridView aspxGridView1) { List<GridViewDataColumn> columns = new List<GridViewDataColumn>(); foreach (GridViewColumn column in aspxGridView1.VisibleColumns) { if (column is GridViewDataColumn) columns.Add(column as GridViewDataColumn); } return columns; }
private bool DeleteButtonVisibleCriteria(ASPxGridView grid, int visibleIndex) { object row = grid.GetRow(visibleIndex); return(((SPPBModel.SPPB)(row)).StatusDesc.ToString().ToUpper().Contains("SAVE")); }
protected void FocusThisRowGrid(ASPxGridView grid, int keyVal) { grid.FocusedRowIndex = grid.FindVisibleIndexByKeyValue(keyVal); }
ASPxPageControl FindPageControl(ASPxGridView grid) { return(grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl); }
protected void grid_CerDet_BeforePerformDataSelect(object sender, EventArgs e) { ASPxGridView grd = sender as ASPxGridView; this.dsCertificateDet.FilterExpression = "CerNo='" + SafeValue.SafeInt(grd.GetMasterRowKeyValue(), 0) + "'"; }
/// <summary> /// 绑定超链接 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grid_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e) { ASPxGridView gv = sender as ASPxGridView; DataTable dt = gv.DataSource as DataTable; if (dt != null && e.Column.Index > 2 && e.Value.ToString() != "0") { string date = Convert.ToString(dt.Rows[e.VisibleRowIndex][0]); string shiftName = Convert.ToString(dt.Rows[e.VisibleRowIndex][1]); string trxType = Convert.ToString(dt.Rows[e.VisibleRowIndex][2]); string isHistory = this.rbtHistory.Checked ? "1" : "0"; string colHeader = e.Column.FieldName; var results = from item in this._dtSource.AsEnumerable() where Convert.ToString(item["CALC_DATE"]) == date && Convert.ToString(item["SHIFT_NAME"]) == shiftName && Convert.ToString(item["OPERATION_NAME"]) == colHeader select new { StartTime = item["START_TIME"], EndTime = item["END_TIME"] }; if (colHeader == "SUM_VALUE") { colHeader = "ALL"; results = from item in this._dtSource.AsEnumerable() where Convert.ToString(item["CALC_DATE"]) == date && Convert.ToString(item["SHIFT_NAME"]) == shiftName select new { StartTime = item["START_TIME"], EndTime = item["END_TIME"] }; } string startTime = Convert.ToString(results.Min(a => a.StartTime)); string endTime = Convert.ToString(results.Max(a => a.EndTime)); if (!this.rbtHistory.Checked) { string inputStartTime = this.dateStart.Text + " " + this.deStartTime.Text; string inputEndTime = this.dateEnd.Text + " " + this.deEndTime.Text; if (startTime.CompareTo(inputStartTime) < 0) { startTime = inputStartTime; } if (endTime.CompareTo(inputEndTime) > 0) { endTime = inputEndTime; } } if (sender == this.grid && trxType != "CELL_REAL_SCRAP_QTY") { string url = string.Format(@"WipOperationOutputDetail_Line.aspx?date={0}&shiftName={1}&startTime={2}&endTime={3}&trxType={4}&stepName={5}&roomName={6}&proId={7}&workOrderNo={8}&isHistory={9}&partNumber={10}&oprline={11}", Server.UrlEncode(date), Server.UrlEncode(shiftName), Server.UrlEncode(startTime), Server.UrlEncode(endTime), Server.UrlEncode(trxType), Server.UrlEncode(colHeader), Server.UrlEncode(this.cmbWorkPlace.Text), Server.UrlEncode(this.cmbProduct.Text), Server.UrlEncode(this.cmbWorkOrderNumber.Text), isHistory, Server.UrlEncode(this.cmbPartNumber.Text), Server.UrlEncode(lineName) ); e.DisplayText = string.Format("<a href=\"javascript:void(0);\" onclick=\"javascript:window.open('{1}')\" class=\"dxgv\" style=\"text-decoration:underline;\">{0}</a>", e.Value, url); } } if (e.Column.Index == 2) { e.DisplayText = dic[Convert.ToString(e.Value)]; } if (e.Column.Index > 2 && string.IsNullOrEmpty(e.Value.ToString())) { e.DisplayText = "0"; } }
private void RefreshGrid(ASPxGridView gv) { gv.DataSource = CRUDHelper.ReadAll("", BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.EspacioCont)); gv.DataBind(); }
public StatusBarTemplate(ASPxGridView grid) { _grid = grid; }
//private void SpecificServersRebuildGrids(object fromGridVal, object toGridVal) //{ // ASPxGridView fromGrid = (ASPxGridView)fromGridVal; // ASPxGridView toGrid = (ASPxGridView)toGridVal; // DataTable dataFrom = new DataTable(); // DataTable dataTo = new DataTable(); // dataTo.Columns.Add("ID"); // dataTo.Columns.Add("ServerName"); // dataTo.Columns.Add("Location"); // dataTo.Columns.Add("ServerType"); // if (Session["visible"] != null && Session["visible"] != "") // { // dataFrom = (DataTable)Session["visible"]; // } // //else // //{ // // dataFrom = (DataTable)Session["ServerVisibleDataGrid"]; // //} // List<int> Id = new List<int>(); // List<Object> SelectItemServerID = fromGrid.GetSelectedFieldValues("ID"); // foreach (object SelectItemID in SelectItemServerID) // { // foreach (DataRow Dr in dataFrom.Rows) // { // if (Dr["ID"].ToString() == SelectItemID.ToString()) // { // Id.Add(dataFrom.Rows.IndexOf(Dr)); // dataTo.ImportRow(Dr); // //dataFrom.Rows.Remove(Dr); // } // dataTo.AcceptChanges(); // } // } // foreach (int DrID in Id) // { // dataFrom.Rows[DrID].Delete(); // } // dataFrom.AcceptChanges(); // DataTable NotVisible = new DataTable(); // NotVisible.Columns.Add("ID"); // NotVisible.Columns.Add("ServerName"); // NotVisible.Columns.Add("Location"); // NotVisible.Columns.Add("ServerType"); // if (Session["NotVisible"] != null && Session["NotVisible"] != "") // { // NotVisible = (DataTable)Session["NotVisible"]; // foreach (DataRow dr in dataTo.Rows) // { // NotVisible.ImportRow(dr); // } // } // else // { // Session["NotVisible"] = dataTo; // } // fromGrid.DataSource = dataFrom; // fromGrid.KeyFieldName = "ID"; // fromGrid.DataBind(); // fromGrid.Selection.UnselectAll(); // Session["visible"] = dataFrom; // if (NotVisible.Rows.Count == 0) // { // toGrid.DataSource = (DataTable)Session["NotVisible"]; // } // else // { // toGrid.DataSource = NotVisible; // } // toGrid.KeyFieldName = "ID"; // toGrid.DataBind(); //} private void SpecificServersRebuildGrids(object fromGridVal, object toGridVal, string fromSession, string toSession) { ASPxGridView fromGrid = (ASPxGridView)fromGridVal; ASPxGridView toGrid = (ASPxGridView)toGridVal; DataTable dataFrom = new DataTable(); DataTable dataTo = new DataTable(); dataTo.Columns.Add("ID"); dataTo.Columns.Add("ServerName"); dataTo.Columns.Add("Location"); dataTo.Columns.Add("ServerType"); if (Session[fromSession] != null && Session[fromSession] != "") { dataFrom = (DataTable)Session[fromSession]; } //else //{ // dataFrom = (DataTable)Session["ServerVisibleDataGrid"]; //} List <int> Id = new List <int>(); List <Object> SelectItemServerID = fromGrid.GetSelectedFieldValues("ID"); foreach (object SelectItemID in SelectItemServerID) { foreach (DataRow Dr in dataFrom.Rows) { try { if (Dr["ID"].ToString() == SelectItemID.ToString()) { Id.Add(dataFrom.Rows.IndexOf(Dr)); dataTo.ImportRow(Dr); //dataFrom.Rows.Remove(Dr); } dataTo.AcceptChanges(); } catch { } } } foreach (int DrID in Id) { dataFrom.Rows[DrID].Delete(); } dataFrom.AcceptChanges(); DataTable NotVisible = new DataTable(); NotVisible.Columns.Add("ID"); NotVisible.Columns.Add("ServerName"); NotVisible.Columns.Add("Location"); NotVisible.Columns.Add("ServerType"); if (Session[toSession] != null && Session[toSession] != "") { NotVisible = (DataTable)Session[toSession]; foreach (DataRow dr in dataTo.Rows) { NotVisible.ImportRow(dr); } } else { Session[toSession] = dataTo; } fromGrid.DataSource = dataFrom; fromGrid.KeyFieldName = "ID"; fromGrid.DataBind(); fromGrid.Selection.UnselectAll(); Session[fromSession] = dataFrom; if (NotVisible.Rows.Count == 0) { toGrid.DataSource = (DataTable)Session[toSession]; } else { toGrid.DataSource = NotVisible; } toGrid.KeyFieldName = "ID"; toGrid.DataBind(); //9/21/2015 NS added Session[toSession] = NotVisible; }
protected object GetValueFromControlSettings(ASPxGridView grid, string idName) { return GetValueFromControlGeneric(idName, grid, "settingsPageControl"); }
void InitFilters(ASPxGridView aspxGridView1) { report.FilterString = aspxGridView1.FilterExpression; }
void detailView_Load(object sender, EventArgs e) { ASPxGridView detailView = (ASPxGridView)sender; detailView.DataBind(); }
protected object GetValueFromControlGeneric(string idName, ASPxGridView grid, string pageControlID) { ASPxPageControl pageControl = grid.FindEditFormTemplateControl(pageControlID) as ASPxPageControl; if (pageControl == null) return null; object control = pageControl.FindControl(idName); if (control is ASPxTextBox) { ASPxTextBox t = control as ASPxTextBox; return t.Text; } else if (control is ASPxSpinEdit) { ASPxSpinEdit t = control as ASPxSpinEdit; return t.Value; } else if (control is ASPxDateEdit) { ASPxDateEdit t = control as ASPxDateEdit; return t.Date; } else if (control is ASPxComboBox) { ASPxComboBox t = control as ASPxComboBox; return t.Value; } else if (control is ASPxMemo) { ASPxMemo t = control as ASPxMemo; return t.Text; } else if (control is ASPxCheckBox) { ASPxCheckBox t = control as ASPxCheckBox; return t.Checked; } else if (control is DevExpress.Web.ASPxHtmlEditor.ASPxHtmlEditor) { DevExpress.Web.ASPxHtmlEditor.ASPxHtmlEditor t = control as DevExpress.Web.ASPxHtmlEditor.ASPxHtmlEditor; return t.Html; } return ""; }
void InitSortings(ASPxGridView aspxGridView1) { List<GridViewDataColumn> columns = GetVisibleDataColumns(aspxGridView1); ReadOnlyCollection<GridViewDataColumn> groupedColumns = aspxGridView1.GetGroupedColumns(); for (int i = 0; i < columns.Count; i++) { if (!groupedColumns.Contains(columns[i])) { if (columns[i].SortOrder != ColumnSortOrder.None) ((DetailBand)report.Bands[BandKind.Detail]).SortFields.Add(new GroupField(columns[i].FieldName, columns[i].SortOrder == ColumnSortOrder.Ascending ? XRColumnSortOrder.Ascending : XRColumnSortOrder.Descending)); } } }
private void SetFirstRowChangeAfterInit(ASPxGridView grid, bool value) { grid.ClientSideEvents.Init = string.Format(CultureInfo.InvariantCulture, "function (s,e) {{ s.firstRowChangedAfterInit = {0};}}", value ? "true" : "false"); }
private void RefreshGrid(ASPxGridView gv) { gv.DataSource = Business.TecnologiaSoporte.ReadAll(""); gv.DataBind(); }
protected void ASPxGridView2_BeforePerformDataSelect(object sender, EventArgs e) { ASPxGridView grdTransactionDetail = (ASPxGridView)sender; Session["TransactionId"] = grdTransactionDetail.GetMasterRowKeyValue(); }
protected void CapexGridApproval_DataBound(object sender, EventArgs e) { ASPxGridView grid = sender as ASPxGridView; MRPClass.VisibilityRevDesc(grid, entitycode); }
public XtraReport GenerateReport(ASPxGridView aspxGridView1, SqlDataSource aspDataSource) { report = new XtraReport(); report.Landscape = true; report.PaperKind = System.Drawing.Printing.PaperKind.Letter; InitDataSource(aspDataSource); InitDetailsAndPageHeader(aspxGridView1); InitSortings(aspxGridView1); InitGroupHeaders(aspxGridView1); InitFilters(aspxGridView1); InitTotalSummaries(aspxGridView1); return report; }
protected string SaveJob() { try { ASPxGridView g = this.grid_Transport; ASPxTextBox houseId = g.FindEditFormTemplateControl("txt_Id") as ASPxTextBox; int Id = SafeValue.SafeInt(houseId.Text, 0); ASPxTextBox parentId = g.FindEditFormTemplateControl("txt_ParentId") as ASPxTextBox; Wilson.ORMapper.OPathQuery query = new Wilson.ORMapper.OPathQuery(typeof(Container), "Id='" + Id + "'"); Container al = C2.Manager.ORManager.GetObject(query) as Container; bool isNew = false; if (Id == 0) { isNew = true; al = new Container(); } ASPxTextBox containerNo = g.FindEditFormTemplateControl("txt_ContainerNo") as ASPxTextBox; ASPxComboBox containerType = g.FindEditFormTemplateControl("cmb_ContainerType") as ASPxComboBox; if (containerNo.Text.Trim().Length == 0 || containerType.Text.Trim().Length == 0) { return("ContainerNo and ContainerType are require"); } string checkContainerNO = "select COUNT(*) from Ref_Container where [id]<>" + Id + " and containerNo='" + containerNo.Text + "' "; int checkResult = SafeValue.SafeInt(ConnectSql.GetTab(checkContainerNO).Rows[0][0], 0); if (checkResult > 0) { return("This ContainerNo is Existed"); } al.ContainerNo = containerNo.Text; ASPxDateEdit commDate = g.FindEditFormTemplateControl("date_CommissionDate") as ASPxDateEdit; al.CommDate = commDate.Date; ASPxComboBox containerCategory = g.FindEditFormTemplateControl("cmb_ContainerCategory") as ASPxComboBox; al.TankCat = containerCategory.Text; ASPxTextBox lessor = g.FindEditFormTemplateControl("txt_Lessor") as ASPxTextBox; al.Lessor = lessor.Text; ASPxDateEdit onHireDateTime = g.FindEditFormTemplateControl("date_OnHireDate") as ASPxDateEdit; al.OnHireDateTime = onHireDateTime.Date; ASPxDateEdit offHireDateTime = g.FindEditFormTemplateControl("date_OffHireDate") as ASPxDateEdit; al.OffHireDateTime = offHireDateTime.Date; ASPxDateEdit manuDate = g.FindEditFormTemplateControl("date_Manufacture") as ASPxDateEdit; al.ManuDate = manuDate.Date; ASPxTextBox manufacturer = g.FindEditFormTemplateControl("txt_Manufacturer") as ASPxTextBox; al.Manufacturer = manufacturer.Text; ASPxTextBox plateNo = g.FindEditFormTemplateControl("txt_PlateNo") as ASPxTextBox; al.PlateNo = plateNo.Text; al.ContainerType = containerType.Text; ASPxSpinEdit externalLength = g.FindEditFormTemplateControl("spin_ExternalLength") as ASPxSpinEdit; al.ExternalLength = SafeValue.SafeDecimal(externalLength.Value, 0); ASPxSpinEdit externalWidth = g.FindEditFormTemplateControl("spin_ExternalWidth") as ASPxSpinEdit; al.ExternalBreadth = SafeValue.SafeDecimal(externalWidth.Value, 0); ASPxSpinEdit externalHeight = g.FindEditFormTemplateControl("spin_ExternalHeight") as ASPxSpinEdit; al.ExternalHeight = SafeValue.SafeDecimal(externalHeight.Value, 0); ASPxSpinEdit internalLength = g.FindEditFormTemplateControl("spin_InternalLength") as ASPxSpinEdit; al.InternalLength = SafeValue.SafeDecimal(internalLength.Value, 0); ASPxSpinEdit internalBreadth = g.FindEditFormTemplateControl("spin_InternalBreadth") as ASPxSpinEdit; al.InternalBreadth = SafeValue.SafeDecimal(internalBreadth.Value, 0); ASPxSpinEdit internalHeight = g.FindEditFormTemplateControl("spin_InternalHeight") as ASPxSpinEdit; al.InternalHeight = SafeValue.SafeDecimal(internalHeight.Value, 0); ASPxTextBox material = g.FindEditFormTemplateControl("txt_Material") as ASPxTextBox; al.Material = material.Text; ASPxTextBox externalCoat = g.FindEditFormTemplateControl("txt_ExternalCoat") as ASPxTextBox; al.ExternalCoat = externalCoat.Text; ASPxSpinEdit capacity = g.FindEditFormTemplateControl("spin_Capacity") as ASPxSpinEdit; al.Capacity = SafeValue.SafeDecimal(capacity.Value, 0); ASPxSpinEdit maxGrossWeight = g.FindEditFormTemplateControl("spin_MaxGrossWeight") as ASPxSpinEdit; al.MaxGrossWeight = SafeValue.SafeDecimal(maxGrossWeight.Value, 0); ASPxSpinEdit tareWeight = g.FindEditFormTemplateControl("spin_TareWeight") as ASPxSpinEdit; al.TareWeight = SafeValue.SafeDecimal(tareWeight.Value, 0); ASPxSpinEdit maxPayload = g.FindEditFormTemplateControl("spin_MaxPayload") as ASPxSpinEdit; al.MaxPayload = SafeValue.SafeDecimal(maxPayload.Value, 0); ASPxSpinEdit testPress = g.FindEditFormTemplateControl("spin_TestPress") as ASPxSpinEdit; al.TestPress = SafeValue.SafeDecimal(testPress.Value, 0); ASPxSpinEdit thickness = g.FindEditFormTemplateControl("spin_Thickness") as ASPxSpinEdit; al.Thickness = SafeValue.SafeDecimal(thickness.Value, 0); ASPxMemo approvals = g.FindEditFormTemplateControl("txt_Approvals") as ASPxMemo; al.Approvals = approvals.Text; ASPxComboBox inActive = g.FindEditFormTemplateControl("cbb_InActive") as ASPxComboBox; al.StatusCode = inActive.Text; if (isNew) { al.CreateBy = EzshipHelper.GetUserName(); al.CreateDateTime = DateTime.Now; //al.StatusCode = "Use"; C2.Manager.ORManager.StartTracking(al, Wilson.ORMapper.InitialState.Inserted); C2.Manager.ORManager.PersistChanges(al); houseId.Text = al.Id.ToString(); //this.txt_JobNo.Text = tpt1.JobNo; //Session["TptWhere"] = "Id='" + al.Id + "'"; this.dsTransport.FilterExpression = ""; //if (this.grid_Transport.GetRow(0) != null) // this.grid_Transport.StartEdit(this.grid_Transport.VisibleRowCount); } else { al.UpdateBy = EzshipHelper.GetUserName(); al.UpdateDateTime = DateTime.Now; C2.Manager.ORManager.StartTracking(al, Wilson.ORMapper.InitialState.Updated); C2.Manager.ORManager.PersistChanges(al); } this.grid_Transport.CancelEdit(); } catch (Exception ex) { throw new Exception(ex.Message + ex.StackTrace); } return("Success"); }
private List<ColumnInfo> GetColumnsInfo(ASPxGridView aspxGridView1, int pagewidth) { List<ColumnInfo> columns = new List<ColumnInfo>(); List<GridViewDataColumn> visibleColumns = GetVisibleDataColumns(aspxGridView1); foreach (GridViewDataColumn dataColumn in visibleColumns) { ColumnInfo column = new ColumnInfo(dataColumn) { ColumnCaption = string.IsNullOrEmpty(dataColumn.Caption) ? dataColumn.FieldName : dataColumn.Caption, ColumnWidth = ((int)pagewidth / visibleColumns.Count), FieldName = dataColumn.FieldName, IsVisible = true }; columns.Add(column); } return columns; }
protected void grdSCMProcurementOffDetails_BeforeGetCallbackResult(object sender, EventArgs e) { ASPxGridView grid = sender as ASPxGridView; MRPClass.SetBehaviorGrid(grid); }
protected void grid_InvDet_BeforePerformDataSelect(object sender, EventArgs e) { ASPxGridView grd = sender as ASPxGridView; this.dsArInvoiceDet.FilterExpression = "DocId='" + SafeValue.SafeInt(grd.GetMasterRowKeyValue(), 0) + "'"; }
protected void GridListagem_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; DateTime dtcompensacao = Convert.ToDateTime(e.NewValues["dtcompensacao"]); // uContasPagar.AlteraCompensacao(e.NewValues["ID"].ToString(), dtcompensacao.ToString().Substring(0, 10)); // gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "ALTERAÇÃO CONTAS A PAGAR - COMPENSAÇÃO ID/Lançamento/Data: " + e.NewValues["ID"].ToString() + "/" + e.NewValues["lancamento"].ToString().ToUpper() + "/" + dtcompensacao.ToString().Substring(0, 10); SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "CONTAS A PAGAR"), new SqlParameter("@obs", "ALTERAÇÃO"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); //Todas if (rbparcelasituacao.SelectedIndex == 0) { //Todas/Lançamento if (rbordenacao.SelectedIndex == 0) { GridListagem.Visible = true; AtualizaGrid("T", "L"); } //Todas/Classe Despesa if (rbordenacao.SelectedIndex == 1) { GridListagem.Visible = true; AtualizaGrid("T", "D"); } //Todas/Fornecedores if (rbordenacao.SelectedIndex == 2) { GridListagem.Visible = true; AtualizaGrid("T", "F"); } //Todas/Data Prevista if (rbordenacao.SelectedIndex == 3) { GridListagem.Visible = true; AtualizaGrid("T", "DP"); } //Todas/Data Realizado if (rbordenacao.SelectedIndex == 4) { GridListagem.Visible = true; AtualizaGrid("T", "DR"); } //Todas/Data Nota Fiscal if (rbordenacao.SelectedIndex == 5) { GridListagem.Visible = true; AtualizaGrid("T", "DN"); } } //Previsto if (rbparcelasituacao.SelectedIndex == 1) { //Previsto/Lançamento if (rbordenacao.SelectedIndex == 0) { GridListagem.Visible = true; AtualizaGrid("P", "L"); } //Previsto/Classe Despesa if (rbordenacao.SelectedIndex == 1) { GridListagem.Visible = true; AtualizaGrid("P", "D"); } //Previsto/Fornecedores if (rbordenacao.SelectedIndex == 2) { GridListagem.Visible = true; AtualizaGrid("P", "F"); } //Previsto/Data Prevista if (rbordenacao.SelectedIndex == 3) { GridListagem.Visible = true; AtualizaGrid("P", "DP"); } //Previsto/Data Realizado if (rbordenacao.SelectedIndex == 4) { GridListagem.Visible = true; AtualizaGrid("P", "DR"); } //Previsto/Data Nota Fiscal if (rbordenacao.SelectedIndex == 5) { GridListagem.Visible = true; AtualizaGrid("P", "DN"); } } //Realizado if (rbparcelasituacao.SelectedIndex == 2) { //Realizado/Lançamento if (rbordenacao.SelectedIndex == 0) { GridListagem.Visible = true; AtualizaGrid("R", "L"); } //Realizado/Classe Despesa if (rbordenacao.SelectedIndex == 1) { GridListagem.Visible = true; AtualizaGrid("R", "D"); } //Realizado/Fornecedores if (rbordenacao.SelectedIndex == 2) { GridListagem.Visible = true; AtualizaGrid("R", "F"); } //Realizado/Data Prevista if (rbordenacao.SelectedIndex == 3) { GridListagem.Visible = true; AtualizaGrid("R", "DP"); } //Realizado/Data Realizado if (rbordenacao.SelectedIndex == 4) { GridListagem.Visible = true; AtualizaGrid("R", "DR"); } //Realizado/Data Nota Fiscal if (rbordenacao.SelectedIndex == 5) { GridListagem.Visible = true; AtualizaGrid("R", "DN"); } } }
void InitGroupHeaders(ASPxGridView aspxGridView1) { ReadOnlyCollection<GridViewDataColumn> groupedColumns = aspxGridView1.GetGroupedColumns(); for (int i = groupedColumns.Count - 1; i >= 0; i--) { { GridViewDataColumn groupedColumn = groupedColumns[i]; GroupHeaderBand gb = new GroupHeaderBand(); gb.Height = bandHeight; XRLabel l = new XRLabel(); l.Text = groupedColumn.FieldName + ": [" + groupedColumn.FieldName + "]"; l.LocationF = new PointF(initialGroupOffset + i * 10, 0); l.BackColor = Color.Beige; l.SizeF = new SizeF((report.PageWidth - (report.Margins.Left + report.Margins.Right)) - (initialGroupOffset + i * subGroupOffset), bandHeight); gb.Controls.Add(l); gb.RepeatEveryPage = shouldRepeatGroupHeadersOnEveryPage; GroupField gf = new GroupField(groupedColumn.FieldName, groupedColumn.SortOrder == ColumnSortOrder.Ascending ? XRColumnSortOrder.Ascending : XRColumnSortOrder.Descending); gb.GroupFields.Add(gf); report.Bands.Add(gb); } } }
protected void GridListagem_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxGridView gridView = (ASPxGridView)sender; // string ID = ""; string cod_banco = ""; string nome = ""; DateTime data; string drive = ""; string pasta_remessa = ""; string pasta_retorno = ""; string pasta_envelope = ""; string assunto = ""; string caixa_postal = ""; string mascara_remessa = ""; string mascara_retorno = ""; string nome_arquivo = ""; string numero_arquivo = ""; string prazo_fol = ""; string prazo_dev = ""; string prazo_pro = ""; string multa = ""; string juros = ""; string comissao = ""; string carteira = ""; string num_inicial = ""; string num_final = ""; string sequencia = ""; string numero_atual = ""; string complemento = ""; // // ID = e.NewValues["ID"].ToString(); cod_banco = e.NewValues["cod_banco"].ToString(); nome = e.NewValues["nome"].ToString(); data = Convert.ToDateTime(e.NewValues["data"].ToString().Substring(0, 10)); //drive = e.NewValues["drive"].ToString(); //pasta_remessa = e.NewValues["pasta_remessa"].ToString(); //pasta_retorno = e.NewValues["pasta_retorno"].ToString(); //pasta_envelope = e.NewValues["pasta_envelope"].ToString(); //assunto = e.NewValues["assunto"].ToString(); //caixa_postal = e.NewValues["caixa_postal"].ToString(); //mascara_remessa = e.NewValues["mascara_remessa"].ToString(); //mascara_retorno = e.NewValues["mascara_retorno"].ToString(); //prazo_fol = e.NewValues["prazo_fol"].ToString(); //prazo_dev = e.NewValues["prazo_dev"].ToString(); //prazo_pro = e.NewValues["prazo_pro"].ToString(); //multa = e.NewValues["multa"].ToString(); //juros = e.NewValues["juros"].ToString(); //comissao = e.NewValues["comissao"].ToString(); //carteira = e.NewValues["carteira"].ToString(); //num_inicial = e.NewValues["num_inicial"].ToString(); //num_final = e.NewValues["num_final"].ToString(); //sequencia = e.NewValues["sequencia"].ToString(); //numero_atual = e.NewValues["numero_atual"].ToString(); //complemento = e.NewValues["complemento"].ToString(); uBanco_2.Grava(cod_banco, nome, data, drive, pasta_remessa, pasta_retorno, pasta_envelope, assunto, caixa_postal, mascara_remessa, mascara_retorno, nome_arquivo, numero_arquivo, prazo_fol, prazo_dev, prazo_pro, multa, juros, comissao, carteira, num_inicial, num_final, sequencia, numero_atual, complemento ); gridView.CancelEdit(); e.Cancel = true; //Usando Classe uLog.MakeLog - Gravando Log fwObs_Log = "INCLUI BANCOS: " + cod_banco + "/" + nome; SqlParameter[] param_log = { new SqlParameter("@login", (String)Session["CodUsuario"]), new SqlParameter("@tabela", fWtabela), new SqlParameter("@operacao", "BANCOS"), new SqlParameter("@obs", "INCLUI"), new SqlParameter("@acao", fwObs_Log) }; uLog.MakeLog(param_log); // AtualizaGrid(); }
void InitTotalSummaries(ASPxGridView aspxGridView1) { if (aspxGridView1.TotalSummary.Count > 0) { report.Bands.Add(new ReportFooterBand() { HeightF = bandHeight }); foreach (ASPxSummaryItem item in aspxGridView1.TotalSummary) { GridViewColumn col = aspxGridView1.Columns[item.ShowInColumn == string.Empty ? item.FieldName : item.ShowInColumn]; if (col != null) { if (detailsInfo.Contains(col)) { XRLabel label = new XRLabel(); label.LocationF = ((XRTableCell)detailsInfo[col]).LocationF; label.SizeF = ((XRTableCell)detailsInfo[col]).SizeF; label.DataBindings.Add("Text", null, ((GridViewDataColumn)col).FieldName); label.Summary = new XRSummary() { Running = SummaryRunning.Report }; label.Summary.FormatString = item.DisplayFormat; label.Summary.Func = GetSummaryFunc(item.SummaryType); report.Bands[BandKind.ReportFooter].Controls.Add(label); } } } } }
protected void CapexGridApproval_BeforeGetCallbackResult(object sender, EventArgs e) { ASPxGridView grid = sender as ASPxGridView; MRPClass.SetBehaviorGrid(grid); }