Exemplo n.º 1
0
        protected void Grid2_RowDataBound(object sender, FineUIPro.GridRowEventArgs e)
        {
            AspNet.CheckBoxList ddlPowers = (AspNet.CheckBoxList)Grid2.Rows[e.RowIndex].FindControl("ddlPowers");

            IGrouping <string, Power> powers = e.DataItem.GetType().GetProperty("Powers").GetValue(e.DataItem, null) as IGrouping <string, Power>;

            foreach (Power power in powers.ToList())
            {
                AspNet.ListItem item = new AspNet.ListItem();
                item.Value = power.ID.ToString();
                item.Text  = power.Title;
                item.Attributes["data-qtip"] = power.Name;

                if (_currentRolePowers.ContainsKey(power.Name))
                {
                    item.Selected = true;
                }
                else
                {
                    item.Selected = false;
                }

                ddlPowers.Items.Add(item);
            }
        }
Exemplo n.º 2
0
        //protected void btnSaveClose_Click(object sender, EventArgs e)
        //{
        //    int selectedRowIndex = Grid1.SelectedRowIndex;

        //    string deptID = Grid1.DataKeys[selectedRowIndex][0].ToString();
        //    string deptName = Grid1.DataKeys[selectedRowIndex][1].ToString();

        //    //PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(deptID, deptName)
        //    //     + ActiveWindow.GetHideReference());

        //    PageContext.RegisterStartupScript(String.Format("selectDept({0},{1});", JsHelper.Enquote(deptName), JsHelper.Enquote(deptID)));
        //}


        protected void Grid1_RowDataBound(object sender, FineUIPro.GridRowEventArgs e)
        {
            // 行绑定后,确定应该选择哪一行
            depts dept = e.DataItem as depts;

            if (dept != null && _deptID == dept.ID)
            {
                _selectedRowIndex = e.RowIndex;
            }
        }
Exemplo n.º 3
0
        protected void Grid1_RowDataBound(object sender, FineUIPro.GridRowEventArgs e)
        {
            // e.DataItem  -> System.Data.DataRowView or custom class.
            // e.RowIndex -> Current row index.
            // e.Values -> Rendered html for each column of this row.

            Infobasis.Data.DataEntity.BudgetTemplateData data = e.DataItem as Infobasis.Data.DataEntity.BudgetTemplateData;

            BudgetTemplateStatus status = (BudgetTemplateStatus)data.BudgetTemplateStatus;
        }
Exemplo n.º 4
0
        protected void GridCategoryStock_RowDataBound(object sender, FineUIPro.GridRowEventArgs e)
        {
            DataRowView row = e.DataItem as DataRowView;

            if (row != null)
            {
                decimal rks = 0, sys = 0, kskcs = 0, kfkcs = 0;
                decimal.TryParse(row["RKSL"].ToString(), out rks);
                decimal.TryParse(row["SYSL"].ToString(), out sys);
                decimal.TryParse(row["KSKCSL"].ToString(), out kskcs);
                decimal.TryParse(row["KFKCSL"].ToString(), out kfkcs);

                if (rks != (sys + kskcs + kfkcs))
                {
                    highlightRows.Text += e.RowIndex.ToString() + ",";
                }
            }
        }
Exemplo n.º 5
0
        protected void Grid1_RowDataBound(object sender, FineUIPro.GridRowEventArgs e)
        {
            // e.DataItem  -> System.Data.DataRowView or custom class.
            // e.RowIndex -> Current row index.
            // e.Values -> Rendered html for each column of this row.

            Infobasis.Data.DataEntity.Company company = e.DataItem as Infobasis.Data.DataEntity.Company;

            CompanyStatus companyStatus  = (CompanyStatus)company.CompanyStatus;
            RenderField   rfCompnyStatus = Grid1.FindColumn("CompanyStatus") as RenderField;

            if (companyStatus == CompanyStatus.Expired)
            {
                //e.RowCssClass = "Expired-Company";
                e.CellAttributes[rfCompnyStatus.ColumnIndex]["data-color"] = "Expired-Company";
            }
            else if (companyStatus == CompanyStatus.Disabled)
            {
                //e.RowCssClass = "Disabled-Company";
                e.CellAttributes[rfCompnyStatus.ColumnIndex]["data-color"] = "Disabled-Company";
            }
        }
Exemplo n.º 6
0
 protected void GridSupKC_RowDataBound(object sender, FineUIPro.GridRowEventArgs e)
 {
 }