예제 #1
0
 // When the grid is first loaded,
 // the first row is always selected
 // if then the user clicks on'Delete' button
 // well, you know what happens
 // is there any other way of doing this?
 // IsSynchronizedWithCurrentItem = "False"
 private void paisesGridView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
 {
     if (e.Row.IsSelected)
     {
         e.GridViewDataControl.CurrentItem = null;
     }
 }
예제 #2
0
        void AssociatedObject_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if (e.Row is GridViewHeaderRow || e.Row is GridViewNewRow || e.Row is GridViewFooterRow)
            {
                return;
            }
            var row = e.Row as GridViewRow;

            this.InitializeRowDragAndDrop(row);
        }
예제 #3
0
        private void DtgSubReports_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if (e.DataElement is EntityListReportSubsDTO)
            {
                var data = (e.DataElement as EntityListReportSubsDTO);
                if (data.vwListReports == null || data.vwListReports.Count == 0)
                {
                    SetSubListReports(data);
                }

                SetSubColumns(e.Row);
            }
        }
예제 #4
0
 void dataGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
 {
     if (e.DataElement != null)
     {
         if (DataContainerLoaded != null)
         {
             DataContainerLoaded(this, new DataContainerLoadedArg()
             {
                 DataItem = e.DataElement
             });
         }
     }
 }
예제 #5
0
 void clubsGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
 {
     if (e.Row is GridViewRow)
     {
         if (shouldExpandRowDetails)
         {
             (e.Row as GridViewRow).DetailsVisibility = Visibility.Visible;
         }
         else
         {
             (e.Row as GridViewRow).DetailsVisibility = Visibility.Collapsed;
         }
     }
 }
 /// <summary>
 /// Row Loaded Event, changes the color for StockSpecificDiscount
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgFairValueComposition_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
 {
     if (e.Row != null)
     {
         if (e.Row.DataContext != null)
         {
             var data = e.Row.DataContext as FairValueCompositionSummaryData;
             if (data == null)
             {
                 return;
             }
         }
     }
 }
예제 #7
0
        private void errorGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            GridViewRow row = e.Row as GridViewRow;

            if (row != null)
            {
                ValidationErrorMessage vms = row.DataContext as ValidationErrorMessage;
                if (vms.AllowGoAhead)
                {
                    row.Background = new SolidColorBrush(Color.FromArgb(25, 204, 255, 153));// SolidColorBrush(Colors.Transparent);
                }
                else
                {
                    row.Background = new SolidColorBrush(Color.FromArgb(25, 255, 153, 204));
                }
            }
        }
예제 #8
0
        private void gvData_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            int countC = e.Row.Cells.Count;

            for (int i = 0; i < countC; i++)
            {
                var _cell = e.Row.Cells[i];
                if (_cell.DataContext.ToString() == "System.Data.DataRow")
                {
                    GridViewCell _cellValid = (GridViewCell)e.Row.Cells[i];

                    if (_cellValid.Value == null)
                    {
                        var converter = new System.Windows.Media.BrushConverter();
                        var brush     = (Brush)converter.ConvertFromString("#D32F2F");
                        e.Row.Cells[i].Background = brush;
                    }
                }
            }
        }
예제 #9
0
        private void DtgNewTables_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if (e.DataElement is TableImportItem)
            {
                var tableImportItem = e.DataElement as TableImportItem;

                var tooltip = tableImportItem.Tooltip;
                if (!string.IsNullOrEmpty(tableImportItem.ValidationTooltip))
                {
                    tooltip         += Environment.NewLine + tableImportItem.ValidationTooltip;
                    e.Row.Background = new SolidColorBrush(Colors.Pink);
                }
                else
                {
                    e.Row.Background = new SolidColorBrush(Colors.White);
                }
                if (!string.IsNullOrEmpty(tooltip))
                {
                    ToolTipService.SetToolTip(e.Row, tooltip);
                }

                if (Database.Name.ToLower().StartsWith("DBProductService".ToLower()))
                {
                    if (tableImportItem.Entity.Name == "GenericPersonAddress")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "GenericPerson").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ProductItem")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceRequest").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceAdditionalItem")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceConclusionItem").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "RequestProductPart")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceItem").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceConclusionItem")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceConclusion").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceRequest_RequestType")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceRequest").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceRequestReviewItems")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceRequestReview").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceRequestReviewItems")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceRequestReview").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceItemPartImage")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceItem").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceItemRepair")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceItem").Select = true;
                    }
                    else if (tableImportItem.Entity.Name == "ServiceItemTest")
                    {
                        tableImportItem.Entity.IndependentDataEntry = false;
                        tableImportItem.Relationships.First(x => x.Entity1 == "ServiceItem").Select = true;
                    }
                }
                //if (!string.IsNullOrEmpty(tableImportItem.Tooltip))
                //    ToolTipService.SetToolTip(e.Row, tableImportItem.Tooltip);
                var cell = e.Row.Cells.FirstOrDefault(x => x.Column.Name == "colRelationshipsSuspicious" ||
                                                      x.Column.Name == "colRelationshipsNonSuspicious");
                if (cell != null)
                {
                    DecideCellEnabled(tableImportItem, cell);
                }
            }
        }