Hello,
I use Multiselect without Scrollbars.
When I multiselect items and use SelectFirst / SelectLast with button control the entire selection is gone
How can I do this the right way?
Greetings.
Posted 20 May 2017 - 06:47 AM
Hello,
I use Multiselect without Scrollbars.
When I multiselect items and use SelectFirst / SelectLast with button control the entire selection is gone
How can I do this the right way?
Greetings.
Posted 21 May 2017 - 04:09 PM
Posted 21 May 2017 - 04:15 PM
procedure TNxCustomGrid6.SelectFirst(Shift: TShiftState = []); begin SelectCell(SelectedCol, FirstVisibleRow, Shift); end; procedure TNxCustomGrid6.SelectLast(Shift: TShiftState = []); begin SelectCell(SelectedCol, LastVisibleRow, Shift); end;Can you please tell me if you find any problem with it. I will like to include it in official code.
Posted 21 May 2017 - 06:14 PM
This is not working. Using TNextVirtualGrid6.
When using ssCtrl for Shiftstate screen is not updated. Everything stays the same.
calling DataChange has no effect.
Regards.
Posted 21 May 2017 - 08:19 PM
procedure TForm5.Button1Click(Sender: TObject); begin NextVirtualGrid61.SelectLast([ssCtrl]); end; procedure TForm5.Button2Click(Sender: TObject); begin NextVirtualGrid61.SelectFirst([ssCtrl]); end; procedure TForm5.FormCreate(Sender: TObject); begin NextVirtualGrid61.CellSource := NxVirtualCellSource61; NextVirtualGrid61.DataChanged; end; procedure TForm5.NxVirtualCellSource61GetCell(Sender: TObject; ACol, ARow: Integer; Cell: INxCell); begin Cell.AsString := IntToStr(ARow); end; function TForm5.NxVirtualCellSource61GetRowCount(Sender: TObject): Integer; begin Result := 10; end;Can you tell me do I miss to set something more in this demo?
Posted 21 May 2017 - 08:40 PM
I think I miss recent update. I will check and try again.
Posted 21 May 2017 - 09:37 PM
Now tested your code with latest update and if items are on ONE page seems to be good.
But if you have more pages it stays on the same page.
Please test it with 100 items.
Posted 22 May 2017 - 06:25 PM
Posted 22 May 2017 - 06:37 PM
Thanks that is much better.
Now last situation. I use SelectFirst and SelectLast to jump to begin and/or end of list. I don't want to select de last or first item? Any idea?
Posted 22 May 2017 - 08:55 PM
Posted 22 May 2017 - 09:17 PM
Enough variation now.
When you use twice, selected is corrected.
NextGridBrowser.SelectFirst([ssCtrl]); NextGridBrowser.SelectFirst([ssCtrl]); NextGridBrowser.ScrollToSelected;
Is it a better idea to combine this ScrollToSelected in SelectFirst/SelectLast.See code:
procedure TNxCustomGrid6.SelectFirst(Shift: TShiftState = []); begin SelectCell(SelectedCol, FirstVisibleRow, Shift); ScrollToSelected; end; procedure TNxCustomGrid6.SelectLast(Shift: TShiftState = []); begin SelectCell(SelectedCol, LastVisibleRow, Shift); ScrollToSelected; end;
What do you think?
Posted 22 May 2017 - 09:52 PM
Posted 22 May 2017 - 09:58 PM
Maybe you are right. Thank you.
0 members, 0 guests, 0 anonymous users