Explorar o código

Added ToolTips for DynamicTextColumn and DynamicTemplateColumn
Fixed RowHeights for DynamicDocumentGrid

frogsoftware hai 11 meses
pai
achega
dfadcc1121

+ 15 - 3
inabox.wpf/DynamicGrid/DynamicDocumentGrid.cs

@@ -60,11 +60,22 @@ namespace InABox.DynamicGrid
         // }
         
         public bool ShowSupercededColumn { get; set; }
-        
-        public bool SimpleTemplate { get; set; }
 
-        private DynamicTemplateColumn _template;
+        private bool _simpleTemplate;
+        public bool SimpleTemplate
+        {
+            get => _simpleTemplate;
+            set
+            {
+                _simpleTemplate = value;
+                RowHeight = value
+                    ? 150
+                    : 100;
+            } 
+        }
 
+        private DynamicTemplateColumn _template;
+        
         public DynamicDocumentGrid()
         {
             MultiSelect = false;
@@ -84,6 +95,7 @@ namespace InABox.DynamicGrid
             ActionColumns.Add(_template);
             //supercedecolumn = new DynamicImageColumn(SupercededImage, SupercedeDocument);
             //ActionColumns.Add(supercedecolumn);
+            RowHeight = 100;
         }
 
         protected override void DoDoubleClick(object sender, DynamicGridCellClickEventArgs args)

+ 6 - 2
inabox.wpf/DynamicGrid/UIComponent/DynamicGridGridUIComponent.cs

@@ -863,6 +863,9 @@ public class DynamicGridGridUIComponent<T> : IDynamicGridUIComponent<T>, IDynami
                     newcol.AllowSorting = false;
                     newcol.FilterRowOptionsVisibility = Visibility.Collapsed;
                     newcol.ShowHeaderToolTip = column.ToolTip != null;
+                    
+                    newcol.ShowToolTip = column.ToolTip != null;
+                    newcol.ShowHeaderToolTip = column.ToolTip != null;
 
                     var style = new Style();
                     style.Setters.Add(new Setter(Control.BackgroundProperty, new SolidColorBrush(Colors.Gainsboro)));
@@ -936,8 +939,9 @@ public class DynamicGridGridUIComponent<T> : IDynamicGridUIComponent<T>, IDynami
                     newcol.AllowFiltering = false;
                     newcol.AllowSorting = false;
                     newcol.FilterRowOptionsVisibility = Visibility.Collapsed;
-                    newcol.ShowToolTip = false;
-                    newcol.ShowHeaderToolTip = false;
+                    
+                    newcol.ShowToolTip = column.ToolTip != null;
+                    newcol.ShowHeaderToolTip = column.ToolTip != null;
 
                     var style = new Style();
                     style.Setters.Add(new Setter(Control.BackgroundProperty, new SolidColorBrush(Colors.Gainsboro)));