PrivateSub selectMode_SelectionChanged(sender AsObject, e As SelectionChangedEventArgs)
Dim mode As C1.WPF.FlexGrid.SelectionMode = C1.WPF.FlexGrid.SelectionMode.Cell
SelectCase selectMode.SelectedIndex
Case 0
mode = C1.WPF.FlexGrid.SelectionMode.Cell
Case 1
mode = C1.WPF.FlexGrid.SelectionMode.CellRange
Case 2
mode = C1.WPF.FlexGrid.SelectionMode.Row
Case 3
mode = C1.WPF.FlexGrid.SelectionMode.RowRange
Case 4
mode = C1.WPF.FlexGrid.SelectionMode.ListBox
CaseElse
mode = C1.WPF.FlexGrid.SelectionMode.Cell
EndSelectDim origionMode As C1.WPF.FlexGrid.ScaleMode = _flex.SelectionMode
_flex.SelectionMode = mode
If origionMode = C1.WPF.FlexGrid.SelectionMode.ListBox ThenDim selectedRows As List(Of C1.WPF.FlexGrid.Row) = _flex.Rows.Selected
selectedRows.ForEach(AddressOf ChangeSelected)
EndIfEnd SubSharedSub ChangeSelected(ByVal r As C1.WPF.FlexGrid.Row)
r.Selected = FalseEnd Sub
コードのコピー
privatevoid selectMode_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
C1.WPF.FlexGrid.SelectionMode mode = C1.WPF.FlexGrid.SelectionMode.Cell;
switch (selectMode.SelectedIndex)
{
case 0:
mode = C1.WPF.FlexGrid.SelectionMode.Cell;
break;
case 1:
mode = C1.WPF.FlexGrid.SelectionMode.CellRange;
break;
case 2:
mode = C1.WPF.FlexGrid.SelectionMode.Row;
break;
case 3:
mode = C1.WPF.FlexGrid.SelectionMode.RowRange;
break;
case 4:
mode = C1.WPF.FlexGrid.SelectionMode.ListBox;
break;
default:
mode = C1.WPF.FlexGrid.SelectionMode.Cell;
break;
}
var origionMode = _flex.SelectionMode;
_flex.SelectionMode = mode;
if (origionMode == C1.WPF.FlexGrid.SelectionMode.ListBox)
{
var selectedRows = _flex.Rows.Selected;
selectedRows.ForEach(r => r.Selected = false);
}
}