I have implemented the drag and drop row feature of telerik grid. Now i have to comfirm/prompt user for drag and drop row action with some message like 'Are you sure to drag the selected row?'
I have implemented below two events for the same
1) Client Side:
function onRowDropping(sender, args) {
// some code to do something
}
2) Code behind:
protected void grd_RowDrop(object sender, GridDragDropEventArgs e)
{
// some code to do something
}
So, Please suggest how can we achieve this functionality.
1) Once user attempt to drag and drop the row, a confirmation popup should come.
2) If user confirm the action row should be dropped and re-ordered.
3) Else action should be reverted from client side itself.
Any help would be highely appriciated.
Thnaks,
Manish



01. public class MyGridBehavior : BaseGridBehavior02. {03. 04. 05. public void SelectCellBlock(GridViewCellInfo SelectedCellTopLeft,GridViewCellInfo SelectedNewCell)06. {07. this.GridControl.ClearSelection();08. 09. 10. int TopRowIndex = SelectedCellTopLeft.RowInfo.Index <= SelectedNewCell.RowInfo.Index ? SelectedCellTopLeft.RowInfo.Index : SelectedNewCell.RowInfo.Index;11. int BottomRowIndex = SelectedCellTopLeft.RowInfo.Index >= SelectedNewCell.RowInfo.Index ? SelectedCellTopLeft.RowInfo.Index : SelectedNewCell.RowInfo.Index;12. 13. int LeftColumnIndex = SelectedCellTopLeft.ColumnInfo.Index <= SelectedNewCell.ColumnInfo.Index ? SelectedCellTopLeft.ColumnInfo.Index : SelectedNewCell.ColumnInfo.Index;14. int RightColumnIndex = SelectedCellTopLeft.ColumnInfo.Index >= SelectedNewCell.ColumnInfo.Index ? SelectedCellTopLeft.ColumnInfo.Index : SelectedNewCell.ColumnInfo.Index;15. 16. //this.GridControl.GridNavigator.BeginSelection(new GridNavigationContext() { InputType = InputType.Keyboard, ModifierKeys = Keys.Shift });17. 18. for (int rowIndex = TopRowIndex; rowIndex <= BottomRowIndex; rowIndex++)19. {20. for (int columnIndex = LeftColumnIndex; columnIndex <= RightColumnIndex; columnIndex++)21. {22. this.GridControl.Rows[rowIndex].Cells[columnIndex].IsSelected = true;23. }24. }25. }26. 27. public override bool ProcessKey(KeyEventArgs keys)28. {29. 30. if (keys.Shift && keys.KeyCode ==Keys.Down)31. { 32. GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();33. this.GridControl.GridNavigator.SelectNextRow(1);34. GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();35. SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);36. return false;37. 38. }39. 40. if (keys.Shift && keys.KeyCode == Keys.Up)41. {42. GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();43. this.GridControl.GridNavigator.SelectPreviousRow(1);44. GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();45. SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);46. return false;47. 48. }49. 50. if (keys.Shift && keys.KeyCode == Keys.Left)51. { 52. GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();53. this.GridControl.GridNavigator.SelectPreviousColumn();54. GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();55. SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);56. return false;57. }58. 59. if (keys.Shift && keys.KeyCode == Keys.Right)60. {61. GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();62. this.GridControl.GridNavigator.SelectNextColumn();63. GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();64. SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);65. return false ;66. }67. }68.}


Hello all telerik users,
I'm a new user of Telerik Objects and I have a problem where using a RadDropDownListItem in RadRibbonBarGroup.
In this case (Design form) the datasource property of the RadDropDownListItems is disabled. I don't understand. When I put a RadDropDownListItem elsewhere in the form this property is enabled. And of course I need it would be enabled inside a RadRibbonBarGroup.
I have to say that I'm not a C# or VB user but a Progress OpenEdgeStudio user.
Thanks a lot for your answers.
JP CLARY


Hi,
I am Using Gridview. I am adding the new row in the Grid and Some Rows added Already.How do set Defualt values to Newly Added Row.

