diff --git a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lpi b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lpi index fb5e6982a..76f9df349 100644 --- a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lpi +++ b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lpi @@ -1,7 +1,7 @@ - + @@ -13,9 +13,6 @@ - - - diff --git a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lps b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lps index ff8d0c10c..b06d9b9b5 100644 --- a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lps +++ b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.lps @@ -1,7 +1,7 @@ - + @@ -19,8 +19,8 @@ - - + + @@ -53,14 +53,15 @@ - - - + + + + @@ -103,7 +104,7 @@ - + @@ -116,6 +117,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.res b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.res index e994dfa65..4ff746d8a 100644 Binary files a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.res and b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/project1.res differ diff --git a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/unit1.lfm b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/unit1.lfm index c9e2c1293..dff878906 100644 --- a/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/unit1.lfm +++ b/components/rx/trunk/Demos/RxDBGrid_ExportSpreadsheet/unit1.lfm @@ -12,9 +12,9 @@ object Form1: TForm1 LCLVersion = '1.7' object RxDBGrid1: TRxDBGrid Left = 0 - Height = 463 + Height = 450 Hint = 'Список данных' - Top = 64 + Top = 77 Width = 746 ColumnDefValues.BlobText = '(blob)' TitleButtons = True @@ -28,8 +28,11 @@ object Form1: TForm1 Width = 90 FieldName = 'CODE' EditButtons = <> + Filter.IsNull = False + Filter.IsAll = True Filter.DropDownRows = 0 Filter.EmptyValue = '(Нет)' + Filter.AllValue = '(Все значения)' Filter.EmptyFont.Style = [fsItalic] Filter.ItemIndex = -1 Footers = <> @@ -42,8 +45,11 @@ object Form1: TForm1 Width = 350 FieldName = 'NAME' EditButtons = <> + Filter.IsNull = False + Filter.IsAll = True Filter.DropDownRows = 0 Filter.EmptyValue = '(Нет)' + Filter.AllValue = '(Все значения)' Filter.EmptyFont.Style = [fsItalic] Filter.ItemIndex = -1 Footers = < @@ -70,8 +76,11 @@ object Form1: TForm1 Width = 120 FieldName = 'PRICE' EditButtons = <> + Filter.IsNull = False + Filter.IsAll = True Filter.DropDownRows = 0 Filter.EmptyValue = '(Нет)' + Filter.AllValue = '(Все значения)' Filter.EmptyFont.Style = [fsItalic] Filter.ItemIndex = -1 Footer.Alignment = taRightJustify @@ -154,6 +163,8 @@ object Form1: TForm1 FooterOptions.Color = clYellow FooterOptions.RowCount = 3 FooterOptions.DrawFullLine = False + SearchOptions.QuickSearchOptions = [loCaseInsensitive, loPartialKey] + SearchOptions.FromStart = False OptionsRx = [rdgAllowColumnsForm, rdgAllowDialogFind, rdgFooterRows, rdgAllowToolMenu] FooterColor = clYellow FooterRowCount = 3 @@ -165,28 +176,28 @@ object Form1: TForm1 SelectedColor = clHighlight GridLineStyle = psSolid DataSource = DataSource1 - Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgHeaderPushedLook] + Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiselect, dgHeaderPushedLook] ParentColor = False TabOrder = 0 TitleStyle = tsNative end object Panel1: TPanel Left = 0 - Height = 64 + Height = 77 Top = 0 Width = 746 Align = alTop AutoSize = True - ClientHeight = 64 + ClientHeight = 77 ClientWidth = 746 TabOrder = 1 object Label1: TLabel AnchorSideLeft.Control = Panel1 AnchorSideTop.Control = Panel1 Left = 7 - Height = 17 + Height = 20 Top = 7 - Width = 132 + Width = 145 BorderSpacing.Around = 6 Caption = 'SpeadSheet file name ' ParentColor = False @@ -196,9 +207,9 @@ object Form1: TForm1 AnchorSideTop.Control = Label1 AnchorSideTop.Side = asrBottom Left = 13 - Height = 27 + Height = 37 Hint = 'Укажите имя файла' - Top = 30 + Top = 33 Width = 275 FilterIndex = 0 HideDirectories = False @@ -216,7 +227,7 @@ object Form1: TForm1 Left = 294 Height = 33 Hint = 'Начать выгрузку' - Top = 27 + Top = 35 Width = 87 Caption = 'Export data' OnClick = Button1Click diff --git a/components/rx/trunk/rxdbgrid.pas b/components/rx/trunk/rxdbgrid.pas index d7ae669b6..116e8e103 100644 --- a/components/rx/trunk/rxdbgrid.pas +++ b/components/rx/trunk/rxdbgrid.pas @@ -5402,10 +5402,58 @@ procedure TRxDBGrid.OnCopyCellValue(Sender: TObject); var P:TBookMark; S:string; - i, k:integer; + i, k, j:integer; begin if DatalinkActive then begin + if (dgMultiselect in Options) and (SelectedRows.Count>1) then + begin + S:=''; + DataSource.DataSet.DisableControls; + {$IFDEF NoAutomatedBookmark} + P:=DataSource.DataSet.GetBookmark; + {$ELSE} + P:=DataSource.DataSet.Bookmark; + {$ENDIF} + try + for j:=0 to SelectedRows.Count-1 do + begin + DataSource.DataSet.Bookmark:=SelectedRows[j]; + if S<>'' then + S:=S+LineEnding; + K:=0; + for i:=0 to Columns.Count-1 do + begin + if Assigned(Columns[i].Field) then + begin + if K<>0 then + S:=S+#9; + S:=S+Columns[i].Field.DisplayText; + inc(K); + end; + end; + end; + finally + {$IFDEF NoAutomatedBookmark} + DataSource.DataSet.GotoBookmark(P); + DataSource.DataSet.FreeBookmark(P); + {$ELSE} + DataSource.DataSet.Bookmark:=P; + {$ENDIF} + DataSource.DataSet.EnableControls; + end; + Invalidate; + if S<>'' then + begin + try + Clipboard.Open; + Clipboard.AsText:=S; + finally + Clipboard.Close; + end; + end; + end + else if (dgMultiselect in Options) and (SelectedRows.Count>1) then begin S:='';