/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege);

            if (e.Row.RowType == DataControlRowType.Header)
            {
                ((HtmlInputCheckBox)e.Row.FindControl("chBoxSelectAll")).Attributes.Add("onclick", "return selectAll(this);");
            }
            else if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ((HtmlInputCheckBox)e.Row.FindControl("chBoxSelected")).Attributes.Add("key", "selected");

                int status = Convert.ToInt16(e.Row.Cells[2].Text);

                e.Row.Cells[2].ForeColor = status.Equals(0) ? Color.Blue : Color.Red;

                e.Row.Cells[2].Text = status.ToString().GetStatusCH().HtmlEncode();

                e.StopButton(status);

                status = Convert.ToInt16(e.Row.Cells[5].Text);

                e.Row.Cells[5].ForeColor = status.Equals(0) ? Color.Blue : Color.Red;

                e.Row.Cells[5].Text = status.ToString().GetStatusCH().HtmlEncode();
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege);

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int status = Convert.ToInt16(e.Row.Cells[1].Text);

                e.Row.Cells[1].ForeColor = status.Equals(0) ? Color.Blue : Color.Red;

                e.Row.Cells[1].Text = status.ToString().GetStatusCH().HtmlEncode();

                e.StopButton(status);

                DropDownList ddlIPAddres = (DropDownList)e.Row.FindControl("ddlIPAddres");

                string[] ip_address = e.Row.Cells[8].Text.Trim().Split(',');

                for (int i = 0; i < ip_address.Length; i++)
                {
                    if (!String.IsNullOrEmpty(ip_address[i]))
                    {
                        ddlIPAddres.Items.Add(new ListItem()
                        {
                            Text = ip_address[i], Value = ip_address[i]
                        });
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege);

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int status = Convert.ToInt16(e.Row.Cells[1].Text);

                e.Row.Cells[1].ForeColor = status.Equals(0) ? Color.Blue : Color.Red;

                e.Row.Cells[1].Text = status.ToString().GetStatusCH().HtmlEncode();

                e.StopButton(status);
            }
        }