Jump to content

dbgrid copy cell content


jahlxx

Recommended Posts

Hi,

 

how about in browse mode?

 

OK, let's look at this rough approach

 

1. UniMemo2:

Left = -1000

 

2. UniDBGrid -> ClientEvents -> ExtEvents -> function afterrender:

function afterrender(sender, eOpts)
{
    var me = sender,
        tempCopyEl = MainForm.UniMemo2;
    me.el.addKeyMap({
        key: 67,
        ctrl: true,
        fn: function() {
            tempCopyEl.setValue(me.getSelectionModel().getSelection()[0].data[1]); // value of the second cell, the possibility of arbitrary copying can be expanded here!
            tempCopyEl.focus();
            tempCopyEl.selectText();

            document.execCommand('copy');
        }
    })
}

Now try

 

Best regards,

Link to comment
Share on other sites

Hi,

 

Is not possible select text like in any other web page?

 

Sorry, for example?

 

 

I've also tested with:
Clipboard.AsText := SomeStringData_Variable; 

But don't work in isapi dll, only works in standalone.

 

In web programming, forget about this approach

Link to comment
Share on other sites

Ok.

 

The problem is in my grids:

 

readonly=true

dgediting=false

 

If I put readonly false and dgediting true, works, and the script in your post #12 is not needed.

 

This is not a good solution for me.

 

Any other idea?

 

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...