Dears,,
Using
SelectTypeRow SelectTypeCol SelectTypeCell
above properties how to set that user can select multiple cells but not in different columns.
for example
like below
col1 col2 col3
row1 *
row2 *
row3 *
and not like below
row1 * *
row2 * *
row3 * *
* implies cell is selected
Handle the BeforeSelectChange event, evaluate the e.NewSelections.Cells, and cancel the event if the selection violates whatever rules you have in effect.
using the selected cells collection and through for loop
i'm pasting the values from clipboard. code is as below
For i = 0 To grdData.Selected.Cells.Count - 1 If IsNumeric(Clipboard.GetData(Trim(grdData.ActiveCell.Column.DataType.ToString))) Then grdData.Selected.Cells(i).Value = Val(Clipboard.GetData(Trim(grdData.ActiveCell.Column.DataType.ToString))) Else grdData.Selected.Cells(i).Value = Clipboard.GetData(Trim(grdData.ActiveCell.Column.DataType.ToString)) End If Next
my problem is all the rows were still in edit mode
how to get rid of this problem?
karthimca07 said:using allowmulticelloperation how do i achieve that copy a single cell value and pasting it multiple cells.
There's no built-in functionality for this in the grid. You would have to write code to do the paste operation yourself if you want the data to repeat.
karthimca07 said:and also if it is dropdown column i have to set value property
Pasting into a grid cell is intended to work as though the user entered it, so if will paste the text into the cell. I don't think you can make it paste the value, but maybe you can do this by handling the BeforeMultiCellOperation event of the grid and modifying the clipboard data passed into the event. Or you could cancel the event and explicitly handle the operation yourself by reading the clipboard data and setting the cell values in code.
using allowmulticelloperation how do i achieve that copy a single cell value and pasting it multiple cells.
code plz
and also if it is dropdown column i have to set value property
Yes, you can enable Excel-style cut, copy, and paste using the AllowMultiCellOperation property, which is on the Override object.
Hi,
yes its working
If the range is high its taking much time
is there any special functionality to paste a value in a range of cells.
it should perform like MS excel
After you are done, you can call grid.UpdateData to accept all of the changes on every row.
Alternatively, you could call Update on each row individually as you loop.