Skip to content

Commit 3d95c20

Browse files
authored
Update end-edit-on-cell-radgridview.md
1 parent 7525dc7 commit 3d95c20

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

knowledge-base/end-edit-on-cell-radgridview.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to configure RadGridView to end cell editing when the use
44
type: how-to
55
page_title: How to End Editing on Cell Navigation in RadGridView for WinForms
66
slug: end-editing-on-cell-navigation-radgridview-winforms
7-
tags: radgridview, winforms, celledit, cellnavigation, behavior
7+
tags: gridview, winforms, celledit, cellnavigation, behavior
88
res_type: kb
99
ticketid: 1657423
1010
---
@@ -17,15 +17,15 @@ ticketid: 1657423
1717

1818
## Description
1919

20-
By default, when RadGridView is in edit mode, and the user change the current cell, the new cell enters in edit mode automatically. In some cases, clients may want to change this behaviour and end the editing proccess once the user left the current cell. This behavior is represented in the MS DataGrid control. This article describes how one can achieve the same editing behavior as in MS DataGrid.
20+
By default, when RadGridView is in edit mode, and the user changes the current cell, the new cell enters in edit mode automatically. In some cases, clients may want to change this behavior and end the editing process once the user left the current cell. This behavior is represented in the MS DataGrid control. This article describes how one can achieve the same editing behavior as in MS DataGrid.
2121

2222
## Solution
2323

2424
To achieve the desired behavior where cell editing ends upon navigating to another cell, you can customize the `GridRowBehavior` of RadGridView. This involves creating a custom `GridRowBehavior` and overriding the `OnMouseDownLeft` method.
2525

2626
Here is a custom `GridDataRowBehavior` implementation:
2727

28-
```csharp
28+
````C#
2929
public class CustomGridDataRowBehavior : GridDataRowBehavior
3030
{
3131
protected override bool OnMouseDownLeft(MouseEventArgs e)
@@ -39,14 +39,14 @@ public class CustomGridDataRowBehavior : GridDataRowBehavior
3939
return base.OnMouseDownLeft(e);
4040
}
4141
}
42-
```
42+
````
4343

4444
To apply this custom behavior, register it with your RadGridView. This custom behavior closes the editor when navigating away from a cell. The `CellBeginEdit` event will trigger for every new cell the user navigates to.
4545

46-
```csharp
46+
````C#
4747
// Example of how to register the custom behavior
4848
gridView.GridBehavior = new CustomGridDataRowBehavior();
49-
```
49+
````
5050

5151
## See Also
5252

0 commit comments

Comments
 (0)