Is there any way to get the SelectedCell in a GridView o TreeListView? I 'd like to bind the GridView "SelectedCell" to a ViewModel property.
Thanks...
3 Answers, 1 is accepted
0
Maya
Telerik team
answered on 04 Nov 2010, 05:44 PM
Hi DanĂ,
RadGridView provides a CurrentCell property. Additionally, a collection of all selected cells - SelectedCells is also available.
Let me know if you need any further assistance.
Sincerely yours,
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
On the same subject, I need to know that specific cell (rowid, colid) was selected when you double click on the grid, thanks. We do know how the double click event.
0
Maya
Telerik team
answered on 05 Nov 2010, 09:02 AM
Hello Christian,
Following the example for cell double-clicking, you may get the corresponding column as:
GridViewCellBase cell = args.OriginalSource as GridViewCellBase;
if (cell != null)
{
this.ClickedCell = cell;
var correspondingColumn = cell.Column;
}
}
Considering the getting the row, you find it with the help of the extension method ParentOfType<>:
var correspondingRow = cell.ParentOfType<GridViewRow>();
The row index may be taken with the ItemContainerGenerator:
var rowIndex = this.playersGrid.ItemContainerGenerator.IndexFromContainer(correspondingRow);
Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items