Exemple #1
0
        private void rgvDBAJobs_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            string strState = (String)e.RowElement.RowInfo.Cells["colSTATE"].Value.ToString().ToUpper();

            switch (strState)
            {
            case "EXECUTING":
                e.RowElement.DrawFill      = true;
                e.RowElement.GradientStyle = GradientStyles.Solid;
                e.RowElement.BackColor     = Color.HotPink;
                break;

            case "NOT RUNNING":
                e.RowElement.DrawFill      = true;
                e.RowElement.GradientStyle = GradientStyles.Solid;
                e.RowElement.BackColor     = Color.Yellow;
                break;

            case "COMPLETING":
                e.RowElement.DrawFill      = true;
                e.RowElement.GradientStyle = GradientStyles.Solid;
                e.RowElement.BackColor     = Color.Green;
                gridTimer.Enabled          = false;
                break;

            default:
                e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
                e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
                e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
                break;
            }
        }
Exemple #2
0
 private void CSGridView_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (e.RowElement != null && UseFixedRowHeight)
     {
         e.RowElement.RowInfo.Height = 20;
     }
 }
Exemple #3
0
        private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            if (font == null)
            {
                font = new Font(e.RowElement.Font, FontStyle.Bold);
            }

            int quantity = -1;

            object quantityValue = e.RowElement.RowInfo.Cells["Quantity"].Value;

            if (quantityValue != null && !Convert.IsDBNull(quantityValue))
            {
                quantity = (int)(short)quantityValue;
            }

            if (quantity >= (int)this.radSpinEditorGreater.Value &&
                quantity <= (int)this.radSpinEditorLess.Value)
            {
                e.RowElement.Font      = font;
                e.RowElement.BackColor = Color.Beige;
                e.RowElement.DrawFill  = true;
            }
            else
            {
                e.RowElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
                e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
                e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
            }
        }
 private void radGridViewPacks_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     try
     {
         if (e != null)
         {
             if (e.RowElement != null)
             {
                 if (!(e.RowElement is GridTableHeaderRowElement))
                 {
                     if (e.RowElement.RowInfo.Cells["TypePack_IsShort"] != null)
                     {
                         if (e.RowElement.RowInfo.Cells["TypePack_IsShort"].Value != null)
                         {
                             if (!(bool)e.RowElement.RowInfo.Cells["TypePack_IsShort"].Value)
                             {
                                 e.RowElement.DrawFill  = true;
                                 e.RowElement.BackColor = Color.MediumVioletRed;
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ItemsPublic.ShowMessage(ex.Message);
     }
 }
Exemple #5
0
        private void RadGridView1RowFormatting(object sender, RowFormattingEventArgs e)
        {
            for (int i = 0; i < e.RowElement.RowInfo.Cells.Count; i++)
            {
                if (!e.RowElement.RowInfo.Cells[i].ColumnInfo.FieldName.Equals("Variation"))
                {
                    continue;
                }

                decimal variation = -1;

                object variationValue = e.RowElement.RowInfo.Cells[i].Value;

                if (variationValue != null && !Convert.IsDBNull(variationValue))
                {
                    variation = decimal.Parse(variationValue.ToString());
                }
                if (variation == 0)
                {
                    e.RowElement.ForeColor = Color.Gray;
                }
                if (variation > 0)
                {
                    e.RowElement.ForeColor = Color.Green;
                }
                else if (variation < 0)
                {
                    e.RowElement.ForeColor = Color.Red;
                }
            }
        }
Exemple #6
0
        void radGridView_ViewRowFormatting(object sender, RowFormattingEventArgs e)
        {
            GridViewGroupRowInfo groupRow = e.RowElement.RowInfo as GridViewGroupRowInfo;

            if (groupRow != null && groupRow.Group.Key is int)
            {
                e.RowElement.BackColor = Color.FromArgb((int)groupRow.Group.Key);
            }
        }
 private void dgvData_ViewRowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (e.RowElement is GridSummaryRowElement)
     {
         e.RowElement.ForeColor = Color.Navy;
         var f = e.RowElement.Font;
         e.RowElement.Font = new Font(f, FontStyle.Bold);
     }
 }
 void grdNearestDrv_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     try
     {
         e.RowElement.RowInfo.Height = 30;
     }
     catch (Exception ex)
     {
     }
 }
Exemple #9
0
 /// <summary>
 /// Ustawia komórki grida.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">CellFormattingEventArgs.</param>
 private void CarServicesCarGridView_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (e.RowElement.RowInfo.Cells[CarServicesCarGridView.ColumnCount - 1].Value != null)
     {
         e.RowElement.DrawFill      = true;
         e.RowElement.GradientStyle = GradientStyles.Solid;
         e.RowElement.BackColor     = Color.LightGray;
         e.RowElement.Enabled       = false;
     }
 }
Exemple #10
0
        private void GridLibros_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            var titulo = e.RowElement.Data.DataBoundItem as TituloDto;

            if (titulo != null)
            {
                if (titulo.EstaConsignado)
                {
                    e.RowElement.MarcarComoConsignado();
                }
            }
        }
        private void radGridViewPersons_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            try
            {
                if (!ItemsPublic.IsnewRowAdded && ItemsPublic.MyRights.Contains(ServerClasses.AllFunctions._Rights.View_persons))
                {
                    if (e != null)
                    {
                        if (e.RowElement != null)
                        {
                            if (!(e.RowElement is GridTableHeaderRowElement))
                            {
                                if (e.RowElement.RowInfo.Cells["Person_ID"] != null)
                                {
                                    if (e.RowElement.RowInfo.Cells["Person_HaveForm"] != null)
                                    {
                                        //var tempId = bool.Parse(e.RowElement.RowInfo.Cells["Person_IsBlackTemp"].Value.ToString());
                                        //if(e.RowElement.RowInfo.Cells["Person_IsBlackTemp"]!=null)
                                        if (e.RowElement.RowInfo.Cells["Person_IsBlackTemp"] != null)
                                        {
                                            bool?tempIsBlack = (bool)e.RowElement.RowInfo.Cells["Person_IsBlackTemp"].Value;

                                            if (tempIsBlack == true)
                                            {
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.PaleVioletRed;
                                            }
                                            else if (e.RowElement.RowInfo.Cells["Person_SecureFormDate"].Value == null || string.IsNullOrEmpty(e.RowElement.RowInfo.Cells["Person_SecureFormDate"].Value.ToString()))
                                            {
                                                //  DateTime? dd = (DateTime?)e.RowElement.RowInfo.Cells["Person_SecureFormDate"].Value;
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.PaleGoldenrod;
                                            }
                                            else
                                            {
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.White;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //ItemsPublic.ShowMessage("رنگ نگاری ناقص"+ "\r\n"+ex.Message);
                ItemsPublic.Exeptor("رنگ نگاری ناقص" + "\r\n" + ex.Message);
            }
        }
        //private void cmbDrivedEntities_SelectedIndexChanged(object sender, EventArgs e)
        //{


        //}
        //void dtgRelationships_ValueChanged(object sender, EventArgs e)
        //{
        //    if (this.dtgRelationships.ActiveEditor is RadCheckBoxEditor)
        //    {
        //        if (dtgRelationships.CurrentCell.RowInfo.DataBoundItem is RelationshipDTO)
        //        {
        //            CheckColumnThroughRelationship((dtgRelationships.CurrentCell.RowInfo.DataBoundItem as RelationshipDTO), Convert.ToBoolean(dtgRelationships.ActiveEditor.Value));

        //        }
        //    }
        //}

        //private void CheckColumnThroughRelationship(RelationshipDTO relationshipDTO, bool value)
        //{
        //    if (value)
        //    {
        //        using (var projectContext = new DataAccess.MyProjectEntities())
        //        {
        //            var dbRelationship = projectContext.Relationship.First(x => x.ID == relationshipDTO.ID);
        //            foreach (var relColumn in dbRelationship.RelationshipColumns)
        //            {

        //            }
        //        }
        //    }
        //}



        void dtgRelationships_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            if (e.RowElement.RowInfo.DataBoundItem != null)
            {
                if (e.RowElement.RowInfo.DataBoundItem is RelationshipDTO)
                {
                    if ((e.RowElement.RowInfo.DataBoundItem as RelationshipDTO).Enabled == false)
                    {
                        e.RowElement.Enabled = false;
                    }
                }
            }
        }
        private void gvDailyMeasures_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            var measure = e.RowElement.Data.DataBoundItem as DailyStandardMeasure;

            if (measure != null)
            {
                if (!CanEditMeasure(measure))
                {
                    e.RowElement.DrawFill      = true;
                    e.RowElement.GradientStyle = GradientStyles.Solid;
                    e.RowElement.BackColor     = Color.LightGray;
                }
            }
        }
Exemple #14
0
 //Grid
 private void mailsGridView_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if ((EmailStatus)e.RowElement.RowInfo.Cells["Status"].Value == EmailStatus.Unread)
     {
         if (boldFont == null)
         {
             boldFont = new Font(e.RowElement.Font.Name, e.RowElement.Font.Size, FontStyle.Bold);
         }
         e.RowElement.Font = boldFont;
     }
     else
     {
         e.RowElement.ResetValue(GridRowElement.FontProperty, ValueResetFlags.Local);
     }
 }
Exemple #15
0
 private void radGridView3_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (!e.RowElement.RowInfo.Cells["Адрес ГИССЗ"].Value.ToString().Contains(e.RowElement.RowInfo.Cells["cou"].Value.ToString()))
     {
         e.RowElement.DrawFill      = true;
         e.RowElement.GradientStyle = GradientStyles.Solid;
         e.RowElement.BackColor     = Color.Red;
     }
     else
     {
         e.RowElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local);
         e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
         e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
     }
 }
 public void EventRowFormatting(object sender, RowFormattingEventArgs e)
 {
     // Here we get rid of the default row highlighting fill //
     if (e.RowElement.IsSelected || e.RowElement.IsCurrent)
     {
         e.RowElement.GradientStyle = GradientStyles.Solid;
         e.RowElement.BackColor     = ColorRow;
     }
     else
     {
         e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
         e.RowElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local);
         e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
         e.RowElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
     }
 }
Exemple #17
0
 private void dgvItems_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     try
     {
         //if (e.RowElement.RowInfo.Cells["DTemporal"].Value == null || e.RowElement.RowInfo.Cells["DTemporal"].Value == "" )
         //{
         //   e.RowElement.Enabled = true;
         //}
         //else
         //{
         //   e.RowElement.Enabled = false;
         //}
     }
     catch (Exception ex)
     { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error al formatear las celdas de la grilla.", ex); }
 }
        private void gridLog_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            if (e.RowElement is GridDataRowElement)
            {
                foreach (var cell in e.RowElement.VisualCells)
                {
                    cell.ToolTipText = cell.Text;
                }

                string logLevel = (string)e.RowElement.Data.Cells["level"].Value;

                e.RowElement.DrawBorder          = true;
                e.RowElement.BorderBoxStyle      = BorderBoxStyle.SingleBorder;
                e.RowElement.BorderGradientStyle = GradientStyles.Solid;
                e.RowElement.BorderWidth         = 3;

                if (string.Equals(logLevel, LogLevel.Info.Name, StringComparison.Ordinal))
                {
                    e.RowElement.BorderColor = Color.DarkBlue;
                }
                else if (string.Equals(logLevel, LogLevel.Warn.Name, StringComparison.Ordinal))
                {
                    e.RowElement.BorderColor = Color.Yellow;
                }
                else if (string.Equals(logLevel, LogLevel.Error.Name, StringComparison.Ordinal))
                {
                    e.RowElement.BorderColor = Color.Red;
                }
                else if (string.Equals(logLevel, LogLevel.Fatal.Name, StringComparison.Ordinal))
                {
                    e.RowElement.BorderColor = Color.Red;
                }
                else
                {
                    e.RowElement.ResetValue(LightVisualElement.BorderBoxStyleProperty);
                    e.RowElement.ResetValue(LightVisualElement.BorderColorProperty);
                    e.RowElement.ResetValue(LightVisualElement.BorderGradientStyleProperty);
                    e.RowElement.ResetValue(LightVisualElement.BorderWidthProperty);
                }
            }
        }
        private void MasterTemplate_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            //if (e.RowElement.RowInfo.Cells["VendorNo"].Value == null)
            //{
            //    e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
            //    e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
            //    e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
            //}
            //else if(!e.RowElement.RowInfo.Cells["VendorNo"].Value.Equals(""))
            //{
            //    e.RowElement.DrawFill = true;
            //    // e.RowElement.GradientStyle = GradientStyles.Solid;
            //    e.RowElement.BackColor = Color.WhiteSmoke;

            //}
            //else
            //{
            //    e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
            //    e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
            //    e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
            //}
        }
Exemple #20
0
 private void radGridView4_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (e.RowElement.RowInfo.Cells.Count > 3)
     {
         if (e.RowElement.RowInfo.Cells[2].Value.ToString() == "" && e.RowElement.RowInfo.Cells[3].Value.ToString() == "")
         {
             e.RowElement.DrawFill      = true;
             e.RowElement.GradientStyle = GradientStyles.Solid;
             e.RowElement.BackColor     = System.Drawing.Color.Green;
         }
         else
         {
             if (e.RowElement.RowInfo.Cells[2].Value != null && e.RowElement.RowInfo.Cells[3].Value != null)
             {
                 if (e.RowElement.RowInfo.Cells[3].Value.ToString() != "")
                 {
                     e.RowElement.DrawFill      = true;
                     e.RowElement.GradientStyle = GradientStyles.Solid;
                     e.RowElement.BackColor     = System.Drawing.Color.Red;
                 }
                 else
                 {
                     e.RowElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local);
                     e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
                     e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
                 }
             }
             else
             {
                 e.RowElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local);
                 e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
                 e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
             }
         }
     }
 }
 private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
 {
 }
        private void gvDailyMeasures_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            var measure = e.RowElement.Data.DataBoundItem as DailyStandardMeasure;

            if (measure != null)
            {
                if (!CanEditMeasure(measure))
                {
                    e.RowElement.DrawFill = true;
                    e.RowElement.GradientStyle = GradientStyles.Solid;
                    e.RowElement.BackColor = Color.LightGray;
                }
            }
        }
 private void grvItems_ViewRowFormatting(object sender, RowFormattingEventArgs e)
 {
     Drug drug = e.RowElement.Data.DataBoundItem as Drug;
     if (drug != null && drug.Manual != null)
     {
         e.RowElement.ToolTipText = drug.Manual;
         e.RowElement.AutoToolTip = true;
     }
 }
Exemple #24
0
 private void MasterTemplate_RowFormatting(object sender, RowFormattingEventArgs e)
 {
 }
Exemple #25
0
 private void grids_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (e.RowElement.RowInfo.IsSelected)
     e.RowElement.BackColor = Color.LemonChiffon;
        // e.RowElement.RowInfo.IsVisible = e.RowElement.RowInfo.IsSelected;
 }
 private void gvPatient_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     if (e.RowElement.RowInfo.Cells["STS"].Value.ToString().Trim() == "R")
     {
         e.RowElement.DrawFill = true;
         e.RowElement.GradientStyle = GradientStyles.Solid;
         e.RowElement.BackColor = ColorTranslator.FromHtml("#FFD544");
     }
     else
     {
         e.RowElement.DrawFill = true;
         e.RowElement.GradientStyle = GradientStyles.Solid;
         e.RowElement.BackColor = ColorTranslator.FromHtml("#FFFFFF");
     }
     if (e.RowElement.RowInfo.Cells["IsConvertPreOrder"].Value.ToString().Trim() == "1")
     {
         e.RowElement.ForeColor= ColorTranslator.FromHtml("#22B14C");
     }
     else
     {
         e.RowElement.ForeColor = ColorTranslator.FromHtml("#000000");
     }
 }
Exemple #27
0
        private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            //TimeSpan eight = new TimeSpan(8,0,0);
            TimeSpan ten      = new TimeSpan(10, 0, 0);
            TimeSpan twelve   = new TimeSpan(12, 0, 0);
            TimeSpan fourteen = new TimeSpan(14, 0, 0);
            TimeSpan sixteen  = new TimeSpan(16, 0, 0);
            TimeSpan eighteen = new TimeSpan(18, 0, 0);
            TimeSpan twenty   = new TimeSpan(20, 0, 0);

            PersianDateFormatter pdf = new PersianDateFormatter();
            DateTime             dt  = DateTime.Now;
            TimeSpan             ts  = new TimeSpan(dt.TimeOfDay.Hours, dt.TimeOfDay.Minutes, 0);
            int      gridDate        = Convert.ToInt32(e.RowElement.RowInfo.Cells[5].Value.ToString());
            int      currentDate     = pdf.getDateInteger(dt);
            TimeSpan gridTimeSpan    = (TimeSpan)e.RowElement.RowInfo.Cells[4].Value;

            if (e.RowElement.RowInfo.Index > -1)
            {
                if (TimeSpan.Compare(gridTimeSpan, ts) < 0 && gridDate <= currentDate || gridDate < currentDate)
                {
                    e.RowElement.BackColor = Color.FromArgb(245, 245, 245);
                }
                else
                {
                    if (TimeSpan.Compare(gridTimeSpan, ten) < 0)
                    {
                        //8 10
                        e.RowElement.BackColor = Color.FromArgb(255, 252, 220);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, twelve) < 0)
                    {
                        //10 12
                        e.RowElement.BackColor = Color.FromArgb(255, 247, 179);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, fourteen) < 0)
                    {
                        //12 14
                        e.RowElement.BackColor = Color.FromArgb(255, 232, 138);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, sixteen) < 0)
                    {
                        //14 16
                        e.RowElement.BackColor = Color.FromArgb(255, 193, 74);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, eighteen) < 0)
                    {
                        //16 18
                        e.RowElement.BackColor = Color.FromArgb(255, 189, 234);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, twenty) < 0)
                    {
                        //18 20
                        e.RowElement.BackColor = Color.FromArgb(227, 166, 255);
                    }
                    else
                    {
                        e.RowElement.BackColor = Color.FromArgb(196, 180, 255);
                    }
                }
            }
        }
 private void KardexRadGridView_RowFormatting(object sender, RowFormattingEventArgs e)
 {
 }
        private void GridLibros_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            var titulo = e.RowElement.Data.DataBoundItem as TituloDto;

            if (titulo != null)
            {
                if (titulo.EstaConsignado)
                {
                    e.RowElement.MarcarComoConsignado();
                }
            }
        }
        private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            //TimeSpan eight = new TimeSpan(8,0,0);
            TimeSpan ten = new TimeSpan(10, 0, 0);
            TimeSpan twelve = new TimeSpan(12, 0, 0);
            TimeSpan fourteen = new TimeSpan(14, 0, 0);
            TimeSpan sixteen = new TimeSpan(16, 0, 0);
            TimeSpan eighteen = new TimeSpan(18, 0, 0);
            TimeSpan twenty = new TimeSpan(20, 0, 0);

            PersianDateFormatter pdf = new PersianDateFormatter();
            DateTime dt = DateTime.Now;
            TimeSpan ts = new TimeSpan(dt.TimeOfDay.Hours, dt.TimeOfDay.Minutes, 0);
            int gridDate = Convert.ToInt32(e.RowElement.RowInfo.Cells[5].Value.ToString());
            int currentDate = pdf.getDateInteger(dt);
            TimeSpan gridTimeSpan = (TimeSpan)e.RowElement.RowInfo.Cells[4].Value;
            if (e.RowElement.RowInfo.Index > -1)
            {
                if (TimeSpan.Compare(gridTimeSpan, ts) < 0 && gridDate <= currentDate || gridDate < currentDate)
                {

                    e.RowElement.BackColor = Color.FromArgb(245, 245, 245);
                }
                else
                {
                    if (TimeSpan.Compare(gridTimeSpan, ten) < 0)
                    {
                        //8 10
                        e.RowElement.BackColor = Color.FromArgb(255, 252, 220);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, twelve) < 0)
                    {
                        //10 12
                        e.RowElement.BackColor = Color.FromArgb(255, 247, 179);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, fourteen) < 0)
                    {
                        //12 14
                        e.RowElement.BackColor = Color.FromArgb(255, 232, 138);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, sixteen) < 0)
                    {
                        //14 16
                        e.RowElement.BackColor = Color.FromArgb(255, 193, 74);

                    }
                    else if (TimeSpan.Compare(gridTimeSpan, eighteen) < 0)
                    {
                        //16 18
                        e.RowElement.BackColor = Color.FromArgb(255, 189, 234);
                    }
                    else if (TimeSpan.Compare(gridTimeSpan, twenty) < 0)
                    {
                        //18 20
                        e.RowElement.BackColor = Color.FromArgb(227, 166, 255);
                    }
                    else
                    {
                        e.RowElement.BackColor = Color.FromArgb(196, 180, 255);
                    }
                }

            }
        }
Exemple #31
0
        private void radGridViewAgreements_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            try
            {
                if (!ItemsPublic.IsnewRowAdded && ItemsPublic.MyRights.Contains(ServerClasses.AllFunctions._Rights.View_agreements))
                {
                    if (e != null)
                    {
                        if (e.RowElement != null)
                        {
                            if (!(e.RowElement is GridTableHeaderRowElement))
                            {
                                if (radGridViewAgreements != null)
                                {
                                    if (e.RowElement.RowInfo != null)
                                    {
                                        if (e.RowElement.RowInfo.Cells["Agreement_EndDate"].Value != null)
                                        {
                                            bool isActive = true;;
                                            if (e.RowElement.RowInfo.Cells["Agreement_IsActive"].Value != null)
                                            {
                                                isActive = (bool)e.RowElement.RowInfo.Cells["Agreement_IsActive"].Value;
                                            }
                                            firstTimeRowFormat = DateTime.Now;
                                            endTimeRowFormat   = (DateTime)e.RowElement.RowInfo.Cells["Agreement_EndDate"].Value;
                                            countDay           = 1 + (int)endTimeRowFormat.Subtract(firstTimeRowFormat).TotalDays;

                                            if (countDay < 0 || !isActive)
                                            {
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.LightGray;
                                            }
                                            else if (countDay < 5)
                                            {
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.LightPink;
                                            }
                                            else if (countDay < 15)
                                            {
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.Yellow;
                                            }
                                            else
                                            {
                                                e.RowElement.DrawFill  = true;
                                                e.RowElement.BackColor = Color.White;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //ItemsPublic.ShowMessage("رنگ نگاری ناقص"+ "\r\n"+ex.Message);
                ItemsPublic.Exeptor("رنگ نگاری ناقص" + "\r\n" + ex.Message);
            }
        }
 /// <summary>
 /// The draggable grid view_ row formatting.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void DraggableGridView_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     e.RowElement.AllowDrag = true;
     e.RowElement.AllowDrop = true;
 }
Exemple #33
0
 private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     SetRowErrorText(e.RowElement.RowInfo);
 }
Exemple #34
0
 private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
 {
     e.RowElement.DrawBorder = false;
     e.RowElement.DrawFill   = false;
 }
Exemple #35
0
 private void dgvItems_RowFormatting(object sender, RowFormattingEventArgs e)
 {
 }