Hi, everyone,
I have been using telerik controls for windows for few months now, and this may be a stupid question. I've noticed that when a radgrid has been filtered or sorted, the SelectedRows property shows only one row selected even though more than one has been selected. I had a piece of code that uses that property so that on the edition of one row the value is copied to the other rows.
Here's a sample of my code:
Is this the default behavior? If so, is there a workaround so that I can persist the selected rows programmatically and keep my code as it is? I am using version 2011.02.712.
Thanks for your help,
Mauricio.
I have been using telerik controls for windows for few months now, and this may be a stupid question. I've noticed that when a radgrid has been filtered or sorted, the SelectedRows property shows only one row selected even though more than one has been selected. I had a piece of code that uses that property so that on the edition of one row the value is copied to the other rows.
Here's a sample of my code:
Private
Sub
rgvContractDetails_CellEndEdit(sender
As
Object
, e
As
Telerik.WinControls.UI.GridViewCellEventArgs)
Handles
rgvContractDetails.CellEndEdit
Try
If
rgvContractDetails.SelectedRows.Count > 1
Then
Select
Case
e.Column.Name
Case
"Quantity"
For
Each
Row
As
GridViewRowInfo
In
rgvContractDetails.SelectedRows
Dim
oSelectedItem
As
SalesContractDetail = Row.DataBoundItem
Row.Cells(
"Quantity"
).Value = e.Value
oSelectedItem.QuantityStr = e.Value
oSelectedItem.CalculateBalance()
Row.Cells(
"QtyBalance"
).Value = oSelectedItem.BalanceStr
Next
Case
"QtyCancel"
For
Each
Row
As
GridViewRowInfo
In
rgvContractDetails.SelectedRows
Dim
oSelectedItem
As
SalesContractDetail = Row.DataBoundItem
Row.Cells(
"QtyCancel"
).Value = e.Value
oSelectedItem.CancelStr = e.Value
oSelectedItem.CalculateBalance()
Row.Cells(
"QtyBalance"
).Value = oSelectedItem.BalanceStr
Row.Cells(
"CancelDate"
).Value = Today.ToShortDateString
Next
End
If
Catch
ex
As
Exception
MessageBox.Show(ex.Message,
"Error"
, MessageBoxButtons.OK, MessageBoxIcon.
Error
)
End
Try
End
Sub
Is this the default behavior? If so, is there a workaround so that I can persist the selected rows programmatically and keep my code as it is? I am using version 2011.02.712.
Thanks for your help,
Mauricio.