Beispiel #1
0
    /// <summary>
    /// When edit button is clicked, the RadComboBoc of the selected row is intitalised.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        // Bind AutoComplete values for Manager Column
        if (e.Item is GridEditableItem)
        {
            GridDataItem  gdi = e.Item as GridDataItem;
            GridTableCell gdc = gdi["ManagerNameUnique"] as GridTableCell;

            RadComboBox ManagerCB = (RadComboBox)gdc.FindControl("ManagerRadComboBox");
            if (ManagerCB != null)
            {
                ManagerCB.DataSource = (from r in (Session["data"] as EmployeeDataContract).Employees
                                        select r.Name).ToList <string>();
                ManagerCB.DataBind();

                // Initialize the ComboBox with the already selected text.
                if (Session["ManagerInLabel"] != null)
                {
                    ManagerCB.SelectedIndex = (from i in ManagerCB.Items
                                               where i.Text == Session["ManagerInLabel"].ToString()
                                               select i.Index).First <int>();
                }
                Session["ManagerInLabel"] = null;
            }
        }
    }
Beispiel #2
0
        protected void grdMain_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem gr = (GridDataItem)e.Item;
                DataRowView  dr = (DataRowView)gr.DataItem;


                GridTableCell Linkcell = (GridTableCell)gr["Location_name"];
                Label         link     = (Label)Linkcell.FindControl("locationName");
                GridTableCell gpCell   = (GridTableCell)gr["checkInUser"];
                RadGrid       gpc      = (RadGrid)gpCell.FindControl("grdCurrCheckIn1");

                //GridTableCell gpInnerCell = (GridTableCell)gpc.Columns[0];
                //HyperLink Status = (HyperLink)gpInnerCell.FindControl("lblGuardCIStatus");
                //grdCurrCheckIn_ItemDataBound(object sender, GridItemEventArgs e)

                BindSchedule(gpc, dr, "GetCheckedInGuardsNew", false, true, false);
                //RadGrid gv = ((RadGrid)gr.Cells[1].FindControl("grdCurrCheckOuts"));
                GridTableCell gvCell = (GridTableCell)gr["checkOutUser"];
                RadGrid       gv     = (RadGrid)gpCell.FindControl("grdCurrCheckOuts1");

                BindSchedule(gv, dr, "GetCheckedOutGuardsNew", true, true, true);
                GridTableCell gpCellShift = (GridTableCell)gr["CurrentShift"];
                RadGrid       gpcShift    = (RadGrid)gpCellShift.FindControl("grdCurrentShift1");

                //string shiftCurrId=BindScheduleShift(gpcShift, dr, "CurrentShiftID", false, true, false);
                //BindScheduleShift1(gpcShift, dr, "CurrentShiftID", false, true, false);
                BindScheduleShift(gpcShift, dr, "CurrentShiftTest", false, true, false);
                //BindCurrShiftData(gpcShift,shiftCurrId,"CurrShiftData",false, true, false);

                GridTableCell gvCellShift = (GridTableCell)gr["NextShift"];
                RadGrid       gvShift     = (RadGrid)gvCellShift.FindControl("grdNextShift1");

                //string shiftNextId=BindScheduleShift(gvShift, dr, "NextShiftID", false, true, false);
                BindScheduleShift(gvShift, dr, "NextShift", false, true, false);
                //BindNextShiftData(gvShift,shiftNextId,"NextShiftData", false, true, false);
            }
        }
Beispiel #3
0
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem gdi = (GridDataItem)e.Item;
            try
            {
                if (gdi["ActionColumn"] != null)
                {
                    GridTableCell cell = (GridTableCell)gdi["ActionColumn"];
                    HyperLink     link = (HyperLink)cell.FindControl("Link2");

                    link.Attributes.Add("href", "PopUps/RadWindowContent2.aspx?" +
                                        "ename=" + gdi["enameUnique"].Text.Trim() + "&" +
                                        "job=" + gdi["Job"].Text.Trim() + "&" +
                                        "salary=" + gdi["SalaryUnique"].Text.Trim() + "&" +
                                        "manager=" + gdi["ManagerName"].Text.Trim());
                }
                if (gdi["empnoUnique"] != null)
                {
                    GridTableCell cell = (GridTableCell)gdi["empnoUnique"];
                    HyperLink     link = (HyperLink)cell.FindControl("Link");

                    link.Attributes.Add("href", "PopUps/RadWindowContent.aspx?" +
                                        "ename=" + gdi["enameUnique"].Text.Trim() + "&" +
                                        "job=" + gdi["Job"].Text.Trim() + "&" +
                                        "salary=" + gdi["SalaryUnique"].Text.Trim() + "&" +
                                        "manager=" + gdi["ManagerName"].Text.Trim());
                }
                else if (double.Parse(gdi["SalaryUnique"]
                                      .Text.Replace(",", "").ToString()) <= 25000)
                {
                    gdi["SalaryUnique"].BackColor = Color.Yellow;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    }