Tagged: multiple selection
v_venkie said 3 years ago:
I use Farpoint Spread for Windows Forms v5. I have a requirement to allow a user to select multiple cells and if the user clicks on one of the selected cells, a context menu needs to appear. However, in my case, the moment i click on one of the selected cells, the selection is lost.
I have the following properties on the spread.
spread.SelectionBlockOptions = SelectionBlockOptions.Cells | SelectionBlockOptions.Columns;
spread.ActiveSheet.SelectionPolicy = SelectionPolicy.MultiRange;
I also handle the Cell Click event which performs some actions on my model.
I tried setting
paul1960 said 3 years ago:
Yes if you use multiselect operationmode then the RetainSelectionBlock Property is not used, however you can catch the FpSpread.SelectionChanging Event and change the cancel property of its SelectionChangingEventArgs to = true to cancel the selection change event, you will just need to figure out the conditions under which you want to do that. Here is code I found that canceled the selection change if you clicked on column zero.
C# Copy Code
private void fpSpread1SelectionChanging(object sender, FarPoint.Win.Spread.SelectionChangingEventArgs e)
if (e.CurrentColumn == 0)
e.Cancel = true;
Visual Basic Copy Code
Private Sub FpSpread1SelectionChanging(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.SelectionChangingEventArgs)
If e.CurrentColumn = 0 Then
e.Cancel = True
You must be logged in to reply to this topic.