|
@@ -477,6 +477,15 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
|
|
|
Parent.HandleKey(e);
|
|
|
}
|
|
|
|
|
|
+ private void HeaderCell_RightMouseButtonEvent(object sender, MouseButtonEventArgs e)
|
|
|
+ {
|
|
|
+ if (sender is not TreeGridHeaderCell header) return;
|
|
|
+ var index = _tree.Columns.IndexOf(header.Column);
|
|
|
+ if (GetColumn(index) is not DynamicColumnBase column)
|
|
|
+ return;
|
|
|
+ Parent.OpenColumnMenu(column,true);
|
|
|
+ }
|
|
|
+
|
|
|
private void HeaderCell_LeftMouseButtonEvent(object sender, MouseButtonEventArgs e)
|
|
|
{
|
|
|
if (sender is not TreeGridHeaderCell header) return;
|
|
@@ -498,7 +507,7 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
|
|
|
|
|
|
if (GetColumn(e.RowColumnIndex.ColumnIndex) is not DynamicColumnBase column)
|
|
|
return;
|
|
|
-
|
|
|
+
|
|
|
if(e.ChangedButton == MouseButton.Left)
|
|
|
{
|
|
|
if(column is DynamicActionColumn dac)
|
|
@@ -514,7 +523,7 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Parent.OpenColumnMenu(column);
|
|
|
+ Parent.OpenColumnMenu(column,false);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1268,6 +1277,7 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
|
|
|
|
|
|
var headstyle = GetHeaderCellStyle(column);
|
|
|
headstyle.Setters.Add(new EventSetter(Control.MouseLeftButtonUpEvent, new MouseButtonEventHandler(HeaderCell_LeftMouseButtonEvent)));
|
|
|
+ headstyle.Setters.Add(new EventSetter(Control.MouseRightButtonUpEvent, new MouseButtonEventHandler(HeaderCell_RightMouseButtonEvent)));
|
|
|
newcol.HeaderStyle = headstyle;
|
|
|
|
|
|
_tree.Columns.Add(newcol);
|
|
@@ -1294,6 +1304,7 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
|
|
|
|
|
|
var headstyle = GetHeaderCellStyle(column);
|
|
|
headstyle.Setters.Add(new EventSetter(Control.MouseLeftButtonUpEvent, new MouseButtonEventHandler(HeaderCell_LeftMouseButtonEvent)));
|
|
|
+ headstyle.Setters.Add(new EventSetter(Control.MouseRightButtonUpEvent, new MouseButtonEventHandler(HeaderCell_RightMouseButtonEvent)));
|
|
|
newcol.HeaderStyle = headstyle;
|
|
|
|
|
|
_tree.Columns.Add(newcol);
|
|
@@ -1319,6 +1330,8 @@ public class DynamicGridTreeUIComponent<T, TKey> : IDynamicGridUIComponent<T>, I
|
|
|
|
|
|
var headstyle = GetHeaderCellStyle(column);
|
|
|
headstyle.Setters.Add(new EventSetter(Control.MouseLeftButtonUpEvent, new MouseButtonEventHandler(HeaderCell_LeftMouseButtonEvent)));
|
|
|
+ headstyle.Setters.Add(new EventSetter(Control.MouseRightButtonUpEvent, new MouseButtonEventHandler(HeaderCell_RightMouseButtonEvent)));
|
|
|
+
|
|
|
newcol.HeaderStyle = headstyle;
|
|
|
|
|
|
_tree.Columns.Add(newcol);
|