protected void tAtualizaGrid_Tick(object sender, EventArgs e)
        {
            System.Web.UI.Timer tAtualizaGrid = this.FindControl("tAtualizaGrid") as System.Web.UI.Timer;
            tAtualizaGrid.Enabled = true;

            string srtUsuario = Page.Request.ServerVariables["REMOTE_USER"].Split(char.Parse("\\"))[1];

            DevExpress.Web.ASPxGridView.ASPxGridView dGridMain = this.FindControl("dGridMain") as DevExpress.Web.ASPxGridView.ASPxGridView;

            CarregaGrid(dGridMain, srtUsuario);
        }
Example #2
0
        public void SettingInit(ASPxButton SourceButton, ASPxComboBox SourceComboBox)
        {
            initCommonJavascript();

            if (SourceComboBox == null)
            {
                SourceButton.ClientSideEvents.Click =
                    "function(s, e){ " +
                    string.Format("{0}.PerformCallback('Show');", MainControlClientName) +
                    " }";
            }
            else
            {
                SourceButton.ClientSideEvents.Click =
                    "function(s, e){ " +
                    "var validated = ASPxClientEdit.ValidateEditorsInContainer(" +
                    SourceComboBox.ClientID +
                    ".GetMainElement(), null, true); if (validated) {" +
                    string.Format("{0}.PerformCallback('Show');", MainControlClientName) +
                    " }}";
            }

            DevExpress.Web.ASPxGridView.ASPxGridView grd = (SourceButton.NamingContainer as
                                                            DevExpress.Web.ASPxGridView.GridViewHeaderTemplateContainer).Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent as
                                                           DevExpress.Web.ASPxGridView.ASPxGridView;
            ImportedItemUnitId = Guid.Empty;
            if (grd == null)
            {
                return;
            }

            this.ComboBoxItemUnit = SourceComboBox;

            ItemUnit itemUnit = null;

            if (grd.EditingRowVisibleIndex >= 0)
            {
                ImportedItemUnitId = Guid.Parse(grd.GetRowValues(grd.EditingRowVisibleIndex, "ItemUnitId!Key").ToString());
                itemUnit           = session.GetObjectByKey <ItemUnit>(ImportedItemUnitId);
            }
            else if (grd.IsNewRowEditing && this.ComboBoxItemUnit != null)
            {
                itemUnit = session.GetObjectByKey <ItemUnit>(this.ComboBoxItemUnit.Value);
                if (itemUnit == null)
                {
                    itemUnit = session.GetObjectByKey <ItemUnit>(this.ComboBoxItemUnit.Value);
                }
            }

            if (itemUnit != null)
            {
                lblItem.Text = itemUnit.ItemId.Code;
            }
        }
    //end incremental filtering of company name

    /// <summary>
    /// row created show break pod link button if quote is linked to pod
    /// button clientviasible=false by default
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gridviewPrices1_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            DevExpress.Web.ASPxGridView.ASPxGridView _grid = (DevExpress.Web.ASPxGridView.ASPxGridView)sender;
            Int32 _onKey = e.GetValue("order_no") != null?wwi_func.vint(e.GetValue("order_no").ToString()) : 0;

            if (_onKey > 0)
            {
                //find template controls
                DevExpress.Web.ASPxGridView.GridViewDataColumn _col1 = (DevExpress.Web.ASPxGridView.GridViewDataColumn)_grid.Columns["colorderno"];
                DevExpress.Web.ASPxEditors.ASPxButton          _btn  = (DevExpress.Web.ASPxEditors.ASPxButton)_grid.FindRowCellTemplateControl(e.VisibleIndex, _col1, "dxbtnbreak");
                //var _chk = (DevExpress.Web.ASPxGridView.Rendering.GridViewTableCommandCell)e.Row.Cells[0];
                //and pass data from hidden field if it's stored - make sure text box is ticked
                if (_btn != null)
                {
                    _btn.ClientVisible = true;
                }
            }
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string srtUsuario = Page.Request.ServerVariables["REMOTE_USER"].Split(char.Parse("\\"))[1];
                System.Web.UI.Timer tAtualizaGrid = this.FindControl("tAtualizaGrid") as System.Web.UI.Timer;
                // DevExpress.Web.ASPxGridView.ASPxGridView dGridMain = this.FindControl("dGridMain") as DevExpress.Web.ASPxGridView.ASPxGridView;

                CarregaGrid(dGridMain, srtUsuario);
                tAtualizaGrid.Enabled = true;
            }
            else
            {
                string srtUsuario = Page.Request.ServerVariables["REMOTE_USER"].Split(char.Parse("\\"))[1];
                DevExpress.Web.ASPxGridView.ASPxGridView dGridMain = this.FindControl("dGridMain") as DevExpress.Web.ASPxGridView.ASPxGridView;

                CarregaGrid(dGridMain, srtUsuario);
            }

            if (Page.Request.Form["__EVENTTARGET"] == "Open")
            {
                //Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["EVT_CHAT_INICIO"].ToString());
            }
        }