Erlly and I are working on this together. I have a few questions.
One of our goals is to copy all of the rows of a specified column.
If the grid is grouped, we''d like to highlight and copy all of the displayed values in each row of the selected column to be able to paste them to another app. (Notepad, excel, etc...).
If the grid is not grouped, we''d like to highlight and copy all of the detail rows in a chosen column to be able to paste them to another app. (Notepad, excel, etc...)
We''d like the user to be able to initiate these actions by single clicking on the column''s header cell.
We would also like to give the user the ability to single click in the upper-most left corner cell of the grid and highlight the whole grid so the user can copy what''s visible on the grid and paste to notepad, excel, etc...
We''d like the user to copy and paste what''s on the grid, not the underlying record value. At times, these 2 values conflict.
Currently, when we copy and paste either an individual summary cell, a selected range of summary cells, an individual detail cell, or a selected range of detail cells the problem above occurs.
If we''ve modified the display value (current conversion, or some type of formatting) in either the QueryCellStyleInfo or the PrepareViewStyleInfo event handlers for display in the grid, that value is not copied and pasted - the underlying record value is copied.
If we follow your recommendation (style.GetFormattedText(style.CellValue, GridCellBaseTextInfo.CopyText);
So, if you would want to return a different text to be copied to the clipboard you could handle the GridGroupingControl.QueryCellFormattedText event and check for e.TextInfo == GridCellBaseTextInfo.CopyText;), nothing at all is copied for pasting.
>The text that gets copied is the displayed text. It is dermined by a call to
>So, if you would want to return a different text to be copied to the clipboard you could handle the GridGroupingControl.QueryCellFormattedText event and check for e.TextInfo == GridCellBaseTextInfo.CopyText;
>>The reason for using Table.Selection is that we want to copy the selection to the clipboard versus just keeping track of selected columns. Then the user will paste the selection to a text file or Excel. I think if we do Table.Selection and then do a copy operation(Model.CutPaste.Copy() from an Edit->Copy menu item or the windows'' standard "Ctrl-C") anything in Table.Selection will be copied to the clipboard. Is this correct?
>>A related question is: when data is copied to the clipboard from the grid, is it copied from the underlying table or what is displayed in the grid cell. The reason for the question is that we modify some of the displayed data in QueryCellInfo and PrepareViewStyle (that is: e.Style.CellValue = ''xxx'' or e.Inner.Style.CellValue = ''xxx'' or e.Inner.Style.FormattedText = ''xxx'') and we were wondering whether the modified displayed values were the ones copied to the clipboard or the table values.