Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
IgnoreMultiCellOperation : Columns, Rows, Cells
posted

My grid has a set number of columns and rows.  The last row is a TOTALS row.  I tried to accomplish this with a summary row, but it wouldn't allow me to select and copy the values in the summary row and paste into Excel.  So, I added a final row to the DataTable that's bound to the grid's datasource.

I know that I'm able to suppress MultiCell operations that modify a cell's value by setting the:
DataGrid.DisplayLayout.Bands[0].Columns["Name"].IgnoreMultiCellOperations = DefaultableBoolean.True;

My questions are:
1) Can I accomplish this for a specific row?
2) Can I accomplish this for a specific cell?
3) Can I create a summary row that allows the user to copy its values?

  • 469350
    Suggested Answer
    Offline posted

    curtist said:
    1) Can I accomplish this for a specific row?
    2) Can I accomplish this for a specific cell?

    I don't believe that there are properties for this on the row or the cell. You might be able to handle the BeforeMultiCellOperation event and either Cancel the operation, though.

    What kind of selection options are you allowing? Can the user select multiple rows/cells?

    curtist said:
    3) Can I create a summary row that allows the user to copy its values?

    There is no way to select a summary, so no, there's no way for the user to copy it. Once again, you might be able to add information into the clipboard data by handling the events, but I'm not entirely sure it's possible, and if so, how difficult it would be. I suspect it's probably prohibitively difficult.

    You probably want to prevent the user from pasting, deleting, or cutting the summary row while still allowing them to copy from it... is that right?

    If so, then maybe you could trap the SelectionChanged event of the grid and check the current selection to see if your summary row or any of it's cells are selected.

    Then you could set the AllowMultiCellOperation property on the grid accordingly to either All or Copy.

  • 115
    posted

    Is it possible to supress MultiCell operations for a specific cell or row?