Exemple #1
0
        protected void grdNames_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail)
            {
                string    code = e.GetValue("Code").ToString();
                clsDetail det  = currentDetails.GetDetails(code);

                ASPxPageControl cntrl = ((ASPxGridView)sender).FindDetailRowTemplateControl(e.VisibleIndex, "ASPxPageControl1") as ASPxPageControl;

                ASPxLabel genLab = cntrl.FindControl("ASPxLabel1") as ASPxLabel;
                if (genLab != null)
                {
                    genLab.Text = det.Gender;
                }

                ASPxLabel courtLab = cntrl.FindControl("ASPxLabel2") as ASPxLabel;
                if (courtLab != null)
                {
                    courtLab.Text = det.TitleOfCourt;
                }

                ASPxLabel addrLab = cntrl.FindControl("ASPxLabel3") as ASPxLabel;
                if (addrLab != null)
                {
                    addrLab.Text = det.Address;
                }
            }
        }
 protected void grdData_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail)
     {
         ASPxGridView grdData     = sender as ASPxGridView;
         ASPxGridView grv_hanghoa = grdData.FindDetailRowTemplateControl(e.VisibleIndex, "grv_hanghoa") as ASPxGridView;
         grv_hanghoa.DataSource = new[] {
             new{ productid = "SP0001", productname = "Hàng hóa 1", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hỏng", note = "" },
             new{ productid = "SP0002", productname = "Hàng hóa 2", unit = "Hộp", number = "1.000", numberinventory = "300", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết hạn sử dụng", note = "" },
             new{ productid = "SP0003", productname = "Hàng hóa 3", unit = "Hộp", number = "1.000", numberinventory = "300", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" },
             new{ productid = "SP0004", productname = "Hàng hóa 4", unit = "Hộp", number = "1.000", numberinventory = "300", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" },
             new{ productid = "SP0005", productname = "Hàng hóa 1", unit = "Hộp", number = "1.000", numberinventory = "250", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hỏng", note = "" },
             new{ productid = "SP0006", productname = "Hàng hóa 2", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết hạn sử dụng", note = "" },
             new{ productid = "SP0007", productname = "Hàng hóa 3", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" },
             new{ productid = "SP0008", productname = "Hàng hóa 4", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" },
             new{ productid = "SP0009", productname = "Hàng hóa 1", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hỏng", note = "" },
             new{ productid = "SP00010", productname = "Hàng hóa 2", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết hạn sử dụng", note = "" },
             new{ productid = "SP00011", productname = "Hàng hóa 3", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" },
             new{ productid = "SP00012", productname = "Hàng hóa 4", unit = "Hộp", number = "1.000", numberinventory = "200", returnNumber = "200",
                  priceunit = "100.000", total = "100.000.000", lotid = "SL0001", duedate = "20/10/2015", reason = "Hết nhu cầu", note = "" },
         };
         grv_hanghoa.DataBind();
     }
 }
Exemple #3
0
        protected void gridDistributorsManage_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            // edit link
            //ASPxHyperLink linkEdit = (ASPxHyperLink)
            //    gridDistributorsManage.FindRowCellTemplateControl(e.VisibleIndex,
            //        gridDistributorsManage.Columns["colCommands"] as GridViewDataColumn,
            //        "btnEdit");

            //if (linkEdit != null)
            //{
            //    linkEdit.ClientSideEvents.Click = string.Format("function(s,e){{OnEditClick({0})}}", e.VisibleIndex);
            //}

            //// delete link
            //ASPxHyperLink linkDelete = (ASPxHyperLink)
            //    gridDistributorsManage.FindRowCellTemplateControl(e.VisibleIndex,
            //        gridDistributorsManage.Columns["colCommands"] as GridViewDataColumn,
            //        "btnDelete");

            //if (linkDelete != null)
            //{
            //    object row = gridDistributorsManage.GetRow(e.VisibleIndex);
            //    if(row != null)
            //    {
            //        object name = (row as Distributor).FileAs;
            //        linkDelete.ClientSideEvents.Click = string.Format("function(s,e){{OnDeleteClick({0},{1})}}", name, e.VisibleIndex);
            //    }
            //}
        }
Exemple #4
0
 protected void gvDetailKas_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
         //e.Row.Cells[2].Text = (e.VisibleIndex + 1).ToString();
     }
 }
Exemple #5
0
        protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.VisibleIndex < 0)
            {
                return;
            }
            string compFlag = e.GetValue("COMP_FLAG").ToString();

            switch (compFlag)
            {
            case "0":
                e.Row.BackColor = System.Drawing.Color.White;
                break;

            case "1":
                e.Row.BackColor = System.Drawing.Color.Red;
                break;

            case "2":
                e.Row.BackColor = System.Drawing.Color.Green;
                break;

            default:
                return;
            }
        }
Exemple #6
0
        protected void gvCardiologists_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            //dataLoaded = false;

            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {
                ASPxComboBox cmboBox1 = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "cmbRegStatus") as ASPxComboBox;
                //cmboBox1.AutoPostBack = false;
                cmboBox1.DataSource = regList;
                cmboBox1.TextField  = "Name";
                cmboBox1.ValueField = "ID";
                //cmboBox1.AutoPostBack = true;
                // cmboBox1.DataBind();


                //DropDownList ddRegisStatus = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "ddRegisStatus") as DropDownList;
                //ddRegisStatus.DataSource = regList;
                //ddRegisStatus.DataTextField = "Name";
                //ddRegisStatus.DataValueField = "ID";



                ASPxCheckBox chkc = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "chkCHRC") as ASPxCheckBox;

                if (user.Roles.Contains(Helper.Constants.VALIENT_ROLE))
                {
                    cmboBox1.ReadOnly = true;
                    chkc.ReadOnly     = true;

                    //chkc.Attributes["onclick"] = "event.preventDefault();";
                }
            }

            // dataLoaded = true;
        }
Exemple #7
0
        protected void gvCardiologists_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {
                ASPxComboBox cmboBox1 = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "cmbRegStatus") as ASPxComboBox;

                cmboBox1.DataSource = regList;
                cmboBox1.TextField  = "Name";
                cmboBox1.ValueField = "ID";


                //DropDownList dd = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "dd") as DropDownList;

                //dd.DataSource = regList;
                //dd.DataTextField = "Name";
                //dd.DataValueField = "ID";
                //dd.DataBind();

                ASPxCheckBox chkc = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "chkCHRC") as ASPxCheckBox;

                //if (user.Roles.Contains(Constants.VALIENT_ROLE))
                //{
                //    cmboBox1.ReadOnly = true;
                //    chkc.ReadOnly = true;
                //}
            }
        }
Exemple #8
0
        protected void grid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if ((e.RowType == GridViewRowType.InlineEdit))
            {
                ASPxComboBox combo2 = ((ASPxComboBox)grid.FindEditRowCellTemplateControl(
                                           grid.Columns["Category2ID"] as GridViewDataComboBoxColumn, "Cat2"));
                if (Request.Params[combo2.UniqueID] != null)
                {
                    return;
                }

                if (!grid.IsNewRowEditing)
                {
                    object[] vals = (object[])grid.GetRowValues(grid.EditingRowVisibleIndex,
                                                                new string[] { "Category2ID", "Category3ID", "Category4ID" });
                    ASPxComboBox combo4 = ((ASPxComboBox)grid.FindEditRowCellTemplateControl(
                                               grid.Columns["Category4ID"] as GridViewDataComboBoxColumn, "Cat4"));
                    ASPxComboBox combo3 = ((ASPxComboBox)grid.FindEditRowCellTemplateControl(
                                               grid.Columns["Category3ID"] as GridViewDataComboBoxColumn, "Cat3"));
                    combo2.Value = vals[0];
                    combo3.Value = vals[1];
                    combo4.Value = vals[2];
                }
            }
        }
Exemple #9
0
 protected void ASPxGridView1_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     //Dictionary<TableCell, int> cellRowSpans = new Dictionary<TableCell, int>();
     //MergeCells((InternalTableCell)e.Row.Cells[0], e, "LJBGY");
     //MergeCells((InternalTableCell)e.Row.Cells[1], e,"LJDM");
     //MergeCells((InternalTableCell)e.Row.Cells[2], e, "LJMC");
     //MergeCells((InternalTableCell)e.Row.Cells[3], e);
     //MergeCells((InternalTableCell)e.Row.Cells[6], e);
     //MergeCells((InternalTableCell)e.Row.Cells[7], e);
 }
Exemple #10
0
 protected void grv_SelectPaymentPlan_OnHtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail)
     {
         ASPxGridView grid    = sender as ASPxGridView;
         ASPxGridView subgrid = grid.FindDetailRowTemplateControl(e.VisibleIndex, "grv_PaymentProcess") as ASPxGridView;
         subgrid.DataSource = grv_PaymentProcessSource;
         subgrid.DataBind();
     }
 }
Exemple #11
0
        protected void gvPatients_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            //dataLoaded = false;

            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {
            }

            // dataLoaded = true;
        }
Exemple #12
0
 void grd_addproduct_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex == 1 && flg_master == 1 && e.RowType != GridViewRowType.Detail)
     {
         e.Row.BackColor = System.Drawing.Color.Yellow;
         //foreach (TableCell cell in e.Row.Cells)
         //{
         //    cell.BackColor = System.Drawing.Color.Yellow;
         //}
     }
 }
Exemple #13
0
 protected void gvBaganAkun_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
         var header = e.GetValue("header_info").ToString();
         if (header == "H")
         {
             e.Row.BackColor = System.Drawing.ColorTranslator.FromHtml("#f0f4c3");
         }
     }
 }
Exemple #14
0
 protected void xgvPerson_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
     {
         return;
     }
     //当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色
     e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ffffcd',this.style.fontWeight='';");
     //当鼠标离开的时候 将背景颜色还原的以前的颜色
     e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
 }
        protected void gvCardiologists_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {
                ASPxCheckBox chkc = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "chkCHRC") as ASPxCheckBox;

                //if (user.Roles.Contains(Constants.VALIENT_ROLE))
                //{
                //    cmboBox1.ReadOnly = true;
                //    chkc.ReadOnly = true;
                //}
            }
        }
Exemple #16
0
 protected void VersionInfoGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.EditForm)
     {
         if (e.GetValue("VersionInfoID") != null && e.GetValue("VersionInfoID") != "")
         {
             ASPxWebControl.RedirectOnCallback("VersionInfoEdit.aspx?ID=" + e.GetValue("ID") + "&VersionInfoID=" + e.GetValue("VersionInfoID") + "&PrevPage=CustomerInfo.aspx");
         }
         else
         {
             ASPxWebControl.RedirectOnCallback("VersionInfoEdit.aspx?ID=" + CustomerKey.ToString() + "&PrevPage=CustomerInfo.aspx");
         }
     }
 }
Exemple #17
0
 protected void NotesGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.EditForm)
     {
         if (e.GetValue("NotesID") != null && e.GetValue("NotesID") != "")
         {
             ASPxWebControl.RedirectOnCallback("NotesEdit.aspx?ID=" + e.GetValue("ID") + "&NotesID=" + e.GetValue("NotesID") + "&PrevPage=NotesSearch.aspx");
         }
         else
         {
             ASPxWebControl.RedirectOnCallback("NotesEdit.aspx?PrevPage=NotesSearch.aspx");
         }
     }
 }
Exemple #18
0
 protected void gvParticipantes_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.Group)
     {
         //if (e.Row.Cells[0] != null && e.Row.Cells[0].Controls.Count > 0)
         //    e.Row.Cells[0].Controls[0].Visible = false;
         e.Row.Font.Bold = true;
         e.Row.BackColor = Color.Khaki;
         if (e.Row.Cells[0].HasControls())
         {
             e.Row.Cells[0].Controls[0].Visible = false;
         }
     }
 }
Exemple #19
0
        private void MergeCells(InternalTableCell cell, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e, string type)
        {
            int startIndex = 0, rowSpan = 0;

            GetMergeInf(ref startIndex, ref rowSpan, e, type);
            if (e.VisibleIndex == startIndex)
            {
                cell.RowSpan = rowSpan;
            }
            else if (e.VisibleIndex <= startIndex + rowSpan)
            {
                cell.Visible = false;
            }
        }
Exemple #20
0
 protected void CustomerGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.EditForm)
     {
         if (e.GetValue("ID") != null && e.GetValue("ID") != "")
         {
             ASPxWebControl.RedirectOnCallback("CustomerInfo.aspx?ID=" + e.GetValue("ID") + "&TabIndex=0");
         }
         else
         {
             ASPxWebControl.RedirectOnCallback("CustomerInfo.aspx");
         }
     }
 }
 protected void ASPxGridView1_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail)
     {
         ASPxGridView grdetail = ASPxGridView1.FindDetailRowTemplateControl(e.VisibleIndex, "GridDetail") as ASPxGridView;
         grdetail.DataSource = new[] { new{ ID = "SP001", Name = "Sản phẩm 1", Unit = "Hộp", Quantity = "10", ShortestTime = "25/08/2013", Time = "25/08/2013", Priority = "1", Note = "Cần gấp" },
                                       new{ ID = "SP002", Name = "Sản phẩm 2", Unit = "Thùng", Quantity = "2", ShortestTime = "25/08/2013", Time = "25/08/2013", Priority = "2", Note = "Cần gấp" },
                                       new{ ID = "SP003", Name = "Sản phẩm 3", Unit = "Thùng", Quantity = "4", ShortestTime = "25/08/2013", Time = "25/08/2013", Priority = "3", Note = "" },
                                       new{ ID = "SP004", Name = "Sản phẩm 4", Unit = "Hộp", Quantity = "20", ShortestTime = "25/08/2013", Time = "25/08/2013", Priority = "4", Note = "Dự trữ" },
                                       new{ ID = "SP005", Name = "Sản phẩm 5", Unit = "Hộp", Quantity = "100", ShortestTime = "25/08/2013", Time = "25/08/2013", Priority = "5", Note = "" } };
         grdetail.KeyFieldName = "ID";
         grdetail.DataBind();
     }
 }
Exemple #22
0
    protected void GridMaster_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        //if (e.KeyValue != null)
        //{
        //    string key = e.KeyValue.ToString(); ;
        //    ASPxGridView grid = (ASPxGridView)sender;
        //    var a = (ObjectDataSource)GridMaster.FindEditRowCellTemplateControl(grid.Columns["Company Name"] as GridViewDataColumn, "OdsBreaks");
        //    var b = (HiddenField)GridMaster.FindRowCellTemplateControl(e.VisibleIndex, GridMaster.Columns["Company Name"] as GridViewDataColumn, "hRouteId");

        //    if (b != null)
        //    {
        //        b.Value = key;
        //    }
        //}
    }
Exemple #23
0
        protected void gvJenisBinaLingkungan_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            //if (e.VisibleIndex + 1 > 0)
            //{
            //    if (e.VisibleIndex % 2 != 0)
            //    {
            //        e.Row.BackColor = ColorTranslator.FromHtml("#e5eecf");
            //    }

            //    e.Row.Cells[0].Text = (e.VisibleIndex + 1).ToString() + ".";
            //}
            //else if (e.VisibleIndex + 1 == 0)
            //{
            //    e.Row.Cells[0].Text = "";
            //}
        }
Exemple #24
0
        protected void gvDaftarJrnal_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Group && e.VisibleIndex == 0)
            {
                var count = 1;
                Session["count"]    = count;
                e.Row.Cells[0].Text = count.ToString();
            }
            else if (e.VisibleIndex > 0 && e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Group)
            {
                var count = Convert.ToInt32(Session["count"]) + 1;
                Session["count"] = count;

                e.Row.Cells[0].Text = count.ToString();
            }
        }
Exemple #25
0
        private void GetMergeInf(ref int startIndex, ref int rowSpan, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e, string type)
        {
            string s = e.GetValue(type) as string;

            //string ljdm = e.GetValue("LJDM") as string;
            for (int i = 0; i < ASPxGridView1.VisibleRowCount; i++)
            {
                string _s = ASPxGridView1.GetRowValues(i, type) as string;
                //string _ljdm = ASPxGridView1.GetRowValues(i, "LJDM") as string;
                if (s == _s)//&& ljdm==_ljdm
                {
                    startIndex = i;
                    rowSpan++;
                }
            }
            startIndex = startIndex - rowSpan + 1;
        }
Exemple #26
0
        protected void gridMainLog_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {
                return;
            }
            ChannelLogEnum value = (ChannelLogEnum)e.GetValue("LogType");

            if (value == ChannelLogEnum.ChannelError)
            {
                e.Row.BackColor = System.Drawing.Color.Red;
            }
            else if (value == ChannelLogEnum.ProductError)
            {
                e.Row.BackColor = System.Drawing.Color.Orange;
            }
        }
Exemple #27
0
 protected void grid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == GridViewRowType.Detail)
     {
         ASPxGridView    gridView       = (ASPxGridView)sender;
         ASPxPageControl pc             = (ASPxPageControl)gridView.FindDetailRowTemplateControl(e.VisibleIndex, "ASPxPageControl1");
         ASPxGridView    detailGridView = (ASPxGridView)pc.TabPages[0].FindControl("g_relatedProducts");
         detailGridView.ClientInstanceName = "detailGridView" + e.VisibleIndex.ToString();
         Button button = (Button)pc.TabPages[0].FindControl("Button1");
         button.OnClientClick = "return OnButtonClick(" + e.VisibleIndex.ToString() + ")";
         object selectC = Session[detailGridView.GetMasterRowKeyValue().ToString()];
         if (selectC != null)
         {
             HtmlInputText editor        = (HtmlInputText)pc.TabPages[0].FindControl("SearchString");
             string        selectCommand = selectC.ToString();
             int           indexStart    = selectCommand.IndexOf("%");
             int           indexFinish   = selectCommand.IndexOf("%", indexStart + 1);
             editor.Value = selectCommand.ToString().Substring(indexStart + 1, indexFinish - indexStart - 1);
         }
     }
 }
 protected void grid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.Height = 30;
 }
Exemple #29
0
 protected void grdLeave_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='pink';");
     e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white';");
     //grid.f
 }
Exemple #30
0
        protected void gridview_applykm_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail)
            {
                ASPxGridView    mastergrid = sender as ASPxGridView;
                ASPxPageControl tabs       = mastergrid.FindDetailRowTemplateControl(e.VisibleIndex, "tab_stepkhuyenmai") as ASPxPageControl;
                /* Setting for tab 1 */
                ASPxNavBar     navbar_info          = tabs.TabPages[0].FindControl("navbar_info") as ASPxNavBar;
                ASPxFormLayout form_infoquyenloi    = navbar_info.Groups[1].FindControl("form_infoquyenloi") as ASPxFormLayout;
                ASPxGridView   gridview_hanghoatang = form_infoquyenloi.FindControl("gridview_hanghoatang") as ASPxGridView;
                gridview_hanghoatang.DataSource = new[] {
                    new{ sequenceno    = "01", productid = "SP00001", productname = "Hàng hóa 1", productunitid = "Hộp", lotid = "L00001",
                         condition_buy = "5", condition_give = "1" },
                    new{ sequenceno    = "02", productid = "SP00002", productname = "Hàng hóa 2", productunitid = "Hộp", lotid = "L00002",
                         condition_buy = "10", condition_give = "1" },
                    new{ sequenceno    = "03", productid = "SP00003", productname = "Hàng hóa 3", productunitid = "Thùng", lotid = "L00003",
                         condition_buy = "100", condition_give = "1" },
                };
                gridview_hanghoatang.DataBind();
                gridview_hanghoatang.Visible = true;
                ASPxLabel lbl_title_khuyenmai2 = form_infoquyenloi.FindControl("lbl_title_khuyenmai2") as ASPxLabel;
                lbl_title_khuyenmai2.Visible = true;

                ASPxGridView gridview_hanghoabonus = form_infoquyenloi.FindControl("gridview_hanghoabonus") as ASPxGridView;
                gridview_hanghoabonus.DataSource =
                    new[] {
                    new { TenQuaTang = "Phiếu Giảm Giá", GiaTri = "15.000", SoLuong = "2", ThanhTien = "30.000", MoTa = "NAAN Solution" },
                    new { TenQuaTang = "Gấu Bông", GiaTri = "15.000", SoLuong = "3", ThanhTien = "45.000", MoTa = "NAAN Solution" },
                };
                gridview_hanghoabonus.DataBind();
                gridview_hanghoabonus.Visible = false;

                ASPxLabel      lbl_title_khuyenmai3 = form_infoquyenloi.FindControl("lbl_title_khuyenmai3") as ASPxLabel;
                ASPxRoundPanel round_chietkhau      = form_infoquyenloi.FindControl("round_chietkhau") as ASPxRoundPanel;
                round_chietkhau.Visible      = false;
                lbl_title_khuyenmai3.Visible = false;

                /* Setting for tab 2 */

                ASPxNavBar navbar_nextinfo = tabs.TabPages[1].FindControl("navi_nextinfo") as ASPxNavBar;
                form_infoquyenloi               = navbar_nextinfo.Groups[1].FindControl("form_infoquyenloi") as ASPxFormLayout;
                gridview_hanghoatang            = form_infoquyenloi.FindControl("gridview_hanghoatang") as ASPxGridView;
                gridview_hanghoatang.DataSource = new[] {
                    new{ sequenceno    = "01", productid = "SP00001", productname = "Hàng hóa 1", productunitid = "Hộp", lotid = "L00001",
                         condition_buy = "5", condition_give = "1" },
                    new{ sequenceno    = "02", productid = "SP00002", productname = "Hàng hóa 2", productunitid = "Hộp", lotid = "L00002",
                         condition_buy = "10", condition_give = "1" },
                    new{ sequenceno    = "03", productid = "SP00003", productname = "Hàng hóa 3", productunitid = "Thùng", lotid = "L00003",
                         condition_buy = "100", condition_give = "1" },
                };
                gridview_hanghoatang.DataBind();
                gridview_hanghoatang.Visible = false;
                lbl_title_khuyenmai2         = form_infoquyenloi.FindControl("lbl_title_khuyenmai2") as ASPxLabel;
                lbl_title_khuyenmai2.Visible = false;

                gridview_hanghoabonus            = form_infoquyenloi.FindControl("gridview_hanghoabonus") as ASPxGridView;
                gridview_hanghoabonus.DataSource =
                    new[] {
                    new { TenQuaTang = "Phiếu Giảm Giá", GiaTri = "15.000", SoLuong = "2", ThanhTien = "30.000", MoTa = "NAAN Solution" },
                    new { TenQuaTang = "Gấu Bông", GiaTri = "15.000", SoLuong = "3", ThanhTien = "45.000", MoTa = "NAAN Solution" },
                };
                gridview_hanghoabonus.DataBind();
                gridview_hanghoabonus.Visible = true;
                round_chietkhau         = form_infoquyenloi.FindControl("round_chietkhau") as ASPxRoundPanel;
                round_chietkhau.Visible = true;
            }
        }