I wonder how I can prevent this multi-selection in UlreaGrid although I selected the selection type to Single Row.
Thanks, that works.
Personally, I find that if I am only dealing with a single row, it makes sense to just use the ActiveRow and not allow selection at all. That simplifies things so you don't have to deal with two different rows.
However, if that's not practical for some reason (such as that you are using AppStylist and need to selected row appearance to be applied) then another way to handle it would be to handle the AfterRowActivate event and set Selected to true on the active row. That way, they are always in synch.
Sorry that was the wrong code. I had the problem that I was Loading the DisplayLayout after changeing the SelectType. Unfortunately I am now stuck at a slightly diffrent issue. I am trying to switch between the following two Selection types:
//ultraGrid1.DisplayLayout.Override.ActiveRowAppearance.Reset();
ultraGrid1.DisplayLayout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.ExtendedAutoDrag; ultraGrid1.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.ExtendedAutoDrag; ultraGrid1.DisplayLayout.Override.MaxSelectedCells = 1000; ultraGrid1.DisplayLayout.Override.MaxSelectedRows = 1000; } else { //ultraGrid1.DisplayLayout.Override.ActiveRowAppearance = ultraGrid1.DisplayLayout.Override.SelectedRowAppearance; ultraGrid1.DisplayLayout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.SingleAutoDrag; ultraGrid1.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.SingleAutoDrag; ultraGrid1.DisplayLayout.Override.MaxSelectedCells = 1; ultraGrid1.DisplayLayout.Override.MaxSelectedRows = 1;
When I switch to the second Layout and drag, the Active Row is wanders while the selected row stays put. I would like for the selected row to be the active row.
Thanks
Hi Marcus,
I'm confused by the settings you are applying here and by your description of the issue.
If you are setting SelectTypeRow to None, then why set MaxSelectedRows to 1? These settings are contradicatory. In one case you are saying you want no selected rows and in the other you are saying you want to allow 1 selected row?
In any case, if SelectTypeRow is None, that should take precedence over MaxSelectedRows. So if that's the case and you are somehow seeing two highlighted rows, then I have no explanation why how that could possibly occur. If you can post a small sample project demonstrating this behavior I would be happy to take a look.
Hi, I am having the exact same issue as the above. I have tried disabling multiple selection with following statements:
ultraGrid1.DisplayLayout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.None; ultraGrid1.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.None; ultraGrid1.DisplayLayout.Bands[0].Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.None; ultraGrid1.DisplayLayout.Bands[0].Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.None; ultraGrid1.DisplayLayout.Bands[0].Override.MaxSelectedCells = 1; ultraGrid1.DisplayLayout.Bands[0].Override.MaxSelectedRows = 1; ultraGrid1.DisplayLayout.Override.MaxSelectedCells = 1; ultraGrid1.DisplayLayout.Override.MaxSelectedRows = 1;
unfortunately when I click and drag I get multiple highlighted/selected and one highlighted/active. How do I disable the click drag selection feature?