Ejemplo n.º 1
0
 public static void PageSizeToVietnames(DevExpress.Web.ASPxGridView grid)
 {
     grid.SettingsPager.PageSizeItemSettings.AllItemText = "Tất cả";
     grid.SettingsPager.PageSizeItemSettings.Caption     = "Số dòng / 1 trang:";
     grid.SettingsPager.Summary.AllPagesText             = "Trang: {0} - {1} ({2} bản ghi)";
     grid.SettingsPager.Summary.Text = "Trang {0} / {1} ({2} bản ghi)";
 }
Ejemplo n.º 2
0
        protected void axgvProject_BeforePerformDataSelect(object sender, EventArgs e)
        {
            DevExpress.Web.ASPxGridView CurrentGridView = (DevExpress.Web.ASPxGridView)sender;
            Guid ProjectPlanId = new Guid((sender as DevExpress.Web.ASPxGridView).GetMasterRowKeyValue().ToString());

            BLL.ProjectPlan projectPlan = BLL.ProjectPlan.GetProjectPlan(ProjectPlanId);
            //if (projectPlan.ProjectPlanTypeId.ToString() == "") { CurrentGridView.DataSource = BLL.CustomProject.(); }
            //else {  }
            CurrentGridView.DataSource = BLL.Project.GetProjectByPlanId(ProjectPlanId);

            //CurrentGridView.DataBind();//DataBind()后无限循环
        }
Ejemplo n.º 3
0
 protected void Grid_ToolbarItemClick(object source, DevExpress.Web.Data.ASPxGridViewToolbarItemClickEventArgs e)
 {
     DevExpress.Web.ASPxGridView grid = (DevExpress.Web.ASPxGridView)source;
     switch (e.Item.Name)
     {
         case "CustomExportToXLS":
             grid.ExportXlsToResponse(new DevExpress.XtraPrinting.XlsExportOptionsEx { ExportType = DevExpress.Export.ExportType.WYSIWYG });
             break;
         case "CustomExportToXLSX":
             grid.ExportXlsxToResponse(new DevExpress.XtraPrinting.XlsxExportOptionsEx { ExportType = DevExpress.Export.ExportType.WYSIWYG });
             break;
         default:
             break;
     }
 }
Ejemplo n.º 4
0
 private void ShowToolbars(DevExpress.Web.ASPxGridView grid)
 {
     ((DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridDetailRowTemplate)grid.Templates.DetailRow).CanMinimizeTemplate = false;
     grid.SettingsDetail.AllowOnlyOneMasterRowExpanded = true;
 }
Ejemplo n.º 5
0
 public static void FormatPanel(System.Web.UI.Control p_ctr)
 {
     foreach (System.Web.UI.Control control in p_ctr.Controls)
     {
         if (control.ID != null)
         {
             if (control.ID.Length > 3)
             {
                 if (control.GetType().FullName == "DevExpress.Web.ASPxTextBox")
                 {
                     DevExpress.Web.ASPxTextBox ctr = (DevExpress.Web.ASPxTextBox)control;
                     if (ctr.ValidationSettings.RequiredField.IsRequired == true)
                     {
                         ctr.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFCC");
                     }
                 }
                 if (control.GetType().FullName == "DevExpress.Web.ASPxMemo")
                 {
                     DevExpress.Web.ASPxMemo ctr = (DevExpress.Web.ASPxMemo)control;
                     if (ctr.ValidationSettings.RequiredField.IsRequired == true)
                     {
                         ctr.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFCC");
                     }
                 }
                 else if (control.GetType().FullName == "DevExpress.Web.ASPxComboBox")
                 {
                     DevExpress.Web.ASPxComboBox ctr = (DevExpress.Web.ASPxComboBox)control;
                     ctr.DropDownStyle = DevExpress.Web.DropDownStyle.DropDownList;
                 }
                 else if (control.GetType().FullName == "DevExpress.Web.Bootstrap.BootstrapComboBox")
                 {
                     DevExpress.Web.Bootstrap.BootstrapComboBox ctr = (DevExpress.Web.Bootstrap.BootstrapComboBox)control;
                     ctr.DropDownStyle = DevExpress.Web.DropDownStyle.DropDownList;
                 }
                 else if (control.GetType().FullName == "DevExpress.Web.ASPxDateEdit")
                 {
                     DevExpress.Web.ASPxDateEdit ctr = (DevExpress.Web.ASPxDateEdit)control;
                     ctr.DisplayFormatString = "dd/MM/yyyy";
                     ctr.EditFormat          = DevExpress.Web.EditFormat.Custom;
                     ctr.EditFormatString    = "dd/MM/yyyy";
                 }
                 else if (control.GetType().FullName == "DevExpress.Web.ASPxSpinEdit")
                 {
                     DevExpress.Web.ASPxSpinEdit ctr = (DevExpress.Web.ASPxSpinEdit)control;
                     ctr.MinValue            = 0;
                     ctr.MaxValue            = 9999999999999999999;
                     ctr.Number              = 0;
                     ctr.DisplayFormatString = "#,###";
                     if (ctr.ValidationSettings.RequiredField.IsRequired == true)
                     {
                         ctr.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFCC");
                     }
                 }
                 else if (control.GetType().FullName == "DevExpress.Web.ASPxGridView.ASPxGridView")
                 {
                     DevExpress.Web.ASPxGridView objD = (DevExpress.Web.ASPxGridView)control;
                     for (int i = 0; i < objD.Columns.Count; ++i)
                     {
                         if (objD.Columns[i].GetType().ToString() == "DevExpress.Web.ASPxGridView.GridViewDataDateColumn")
                         {
                             DevExpress.Web.GridViewDataDateColumn gvc = (DevExpress.Web.GridViewDataDateColumn)(objD.Columns[i]);
                             if (gvc.FieldName.IndexOf("DATE") > 0)
                             {
                                 gvc.PropertiesEdit.DisplayFormatString     = "dd/MM/yyyy";
                                 gvc.PropertiesDateEdit.DisplayFormatString = "dd/MM/yyyy";
                                 gvc.PropertiesDateEdit.EditFormatString    = "dd/MM/yyyy";
                             }
                         }
                         else if (objD.Columns[i].GetType().ToString() == "DevExpress.Web.ASPxGridView.GridViewDataTextColumn")
                         {
                             DevExpress.Web.GridViewDataTextColumn gvc = (DevExpress.Web.GridViewDataTextColumn)(objD.Columns[i]);
                             if (gvc.FieldName.IndexOf("AMOUNT") > 0)
                             {
                                 gvc.PropertiesEdit.DisplayFormatString     = "n0";
                                 gvc.PropertiesTextEdit.DisplayFormatString = "n0";
                                 gvc.CellStyle.HorizontalAlign     = System.Web.UI.WebControls.HorizontalAlign.Right;
                                 gvc.CellStyle.VerticalAlign       = System.Web.UI.WebControls.VerticalAlign.Middle;
                                 gvc.EditCellStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Right;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
 private void gridbinddetail(DevExpress.Web.ASPxGridView GridViewDecDtl)
 {
     object[] param = new object[] { GridViewDecDtl.GetMasterRowKeyValue() };
     GridViewDecDtl.DataSource = conn.GetDataTable("EXEC USP_APPDECISIONRESULTDETAIL @1", param, (int)Session["DbTimeOut"]);
     GridViewDecDtl.DataBind();
 }