rhennink Posted November 16, 2020 Share Posted November 16, 2020 Hi, I checked the forums, but cannot find anything working about this, but.. How can I implement drag & drop on a StringGrid. I would like to drag some data from a DBGrid to a cell (converted) in a StringGrid. Thnx! Richard Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 17, 2020 Share Posted November 17, 2020 14 hours ago, rhennink said: I would like to drag some data from a DBGrid to a cell (converted) in a StringGrid. Hi, Need to analyze. Quote Link to comment Share on other sites More sharing options...
bgxbd Posted May 10, 2022 Share Posted May 10, 2022 HI, did you find a solution to drag & drop cells ? Quote Link to comment Share on other sites More sharing options...
rhennink Posted May 11, 2022 Author Share Posted May 11, 2022 NOpe 😞 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted May 12, 2022 Share Posted May 12, 2022 On 11/16/2020 at 10:34 PM, rhennink said: Hi, I checked the forums, but cannot find anything working about this, but.. How can I implement drag & drop on a StringGrid. I would like to drag some data from a DBGrid to a cell (converted) in a StringGrid. Thnx! Richard Hello, You can use standard method to copy data from cells in dbGrid and after drop on StringGrid just Paste clipboard with data. this is how to copy in clipboard: uses Clipbrd; var sData : String; //copy to Clipboard if is used [Ctrl + Left] If Shift = [ssCtrl] then begin Clipboard.AsText := TDBgrid (Sender).Columns [TDBgrid (Sender).SelectedIndex].Field.AsString; end; //copy to clipboard all selected rows if [ctrl + shift] if shift = [ssCtrl,ssShift] then begin sData := ''; //set column's name for I := 0 to TDBgrid (Sender).Columns.Count - 1 do begin if TDBgrid (Sender).Columns[I].Visible then begin sData := sData + TDBgrid (Sender).Columns[I].Title.Caption; if I < (TDBgrid (Sender).Columns.Count - 1) then sData := sData + #9; end; end; sData := sData + #13#10; //read all data for J := 0 to TDBgrid (Sender).SelectedRows.Count - 1 do begin TDBgrid (Sender).DataSource.DataSet.GotoBookmark (TBookmark(TDBgrid (Sender).SelectedRows[J])); for I := 0 to TDBgrid (Sender).Columns.Count - 1 do begin if TDBgrid (Sender).Columns[I].Visible then begin if TDBgrid (Sender).Columns[I].Field <> nil then sData := sData + TDBgrid (Sender).Columns[I].Field.asString else sData := sData + ''; if I < (TDBgrid (Sender).Columns.Count - 1) then sData := sData + #9; end; end; sData := sData + #13#10; end; Clipboard.setTextBuf(PCHAR (sData)); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 12, 2022 Share Posted May 12, 2022 4 minutes ago, irigsoft said: uses Clipbrd; Hello, This will not work (on the client side). Quote Link to comment Share on other sites More sharing options...
irigsoft Posted May 12, 2022 Share Posted May 12, 2022 8 minutes ago, Sherzod said: Hello, This will not work (on the client side). Yes, only on Server side. But is some kind of solution (and I use it on Desktop application). I'm sure the idea can be used. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 12, 2022 Share Posted May 12, 2022 3 minutes ago, irigsoft said: Yes, only on Server side. Yes. 3 minutes ago, irigsoft said: But is some kind of solution (and I use it on Desktop application). OK. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.