Skip to content

Commit a5956f1

Browse files
ES-974685 - Completed Validation for Selection, Editing and ClipboardOperations
1 parent 065edff commit a5956f1

File tree

3 files changed

+67
-83
lines changed

3 files changed

+67
-83
lines changed

wpf/TreeGrid/Clipboard-Operations.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ You can use the IncludeHeaders, IncludeFormat, and IncludeHiddenColumn options a
3232
{% tabs %}
3333
{% highlight xaml %}
3434
<syncfusion:SfTreeGrid Name="treeGrid"
35-
AutoExpandMode="RootNodesExpanded"
36-
AutoGenerateColumns="False"
37-
GridCopyOption="CopyData,IncludeHeaders"
38-
ChildPropertyName="Children"
39-
ColumnSizer="Star"
40-
ExpanderColumn="FirstName"
41-
ItemsSource="{Binding PersonDetails}"
42-
NavigationMode="Row">
35+
AutoExpandMode="RootNodesExpanded"
36+
AutoGenerateColumns="False"
37+
GridCopyOption="CopyData,IncludeHeaders"
38+
ChildPropertyName="Children"
39+
ColumnSizer="Star"
40+
ExpanderColumn="FirstName"
41+
ItemsSource="{Binding PersonDetails}"
42+
NavigationMode="Row">
4343
{% endhighlight %}
4444
{% highlight c# %}
4545

wpf/TreeGrid/Editing.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ N> `TreeGridColumn.AllowEditing` takes higher priority than `SfTreeGrid.AllowEdi
5050

5151
N> It is mandatory to set the NavigationMode to Cell to enable CurrentCell navigation and editing.
5252

53-
### Entering into edit mode
53+
## Entering into edit mode
5454

5555
You can enter into edit mode by pressing <kbd>F2</kbd> key or clicking (touch also supported) the cell. You can allow users to edit the cell in single click (OnTap) or double click (OnDoubleTab) by setting [SfTreeGrid.EditTrigger](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_EditTrigger) property.
5656

@@ -73,7 +73,7 @@ this.treeGrid.EditTrigger = EditTrigger.OnTap;
7373
{% endhighlight %}
7474
{% endtabs %}
7575

76-
### Cursor placement
76+
## Cursor placement
7777

7878
When the cell enters into edit mode, cursor is placed based on [SfTreeGrid.EditorSelectionBehavior](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_EditorSelectionBehavior) property.
7979

@@ -105,13 +105,13 @@ this.treeGrid.EditorSelectionBehavior = EditorSelectionBehavior.SelectAll;
105105

106106
SfTreeGrid supports to commit and roll back the changes in row level when underlying data object implements [IEditableObject](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject?redirectedfrom=MSDN&view=net-5.0) interface.
107107

108-
The editing changes in a row will be committed only when user move to next row or pressing enter key in [EndEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.endedit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_EndEdit). Also when user press &lt;kbd&gt; Esc &lt;/kbd&gt; key, then the changes made in a row will be reverted in [CancelEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.canceledit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_CancelEdit).
108+
The editing changes in a row will be committed only when user move to next row or pressing enter key in [EndEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.endedit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_EndEdit). Also when user press <kbd>Esc</kbd> key, then the changes made in a row will be reverted in [CancelEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.canceledit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_CancelEdit).
109109

110110
`IEditableObject` has the following methods to capture editing,
111111

112112
[BeginEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.beginedit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_BeginEdit) - Gets called to begin edit on underlying data object when cell in a row get into edit mode.
113113

114-
[CancelEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.canceledit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_CancelEdit) - Gets called when user press the &lt;kbd&gt;Esc&lt;/kbd&gt; key to discard the changes in a row since last `BeginEdit` call.
114+
[CancelEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.canceledit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_CancelEdit) - Gets called when user press the <kbd>Esc</kbd> key to discard the changes in a row since last `BeginEdit` call.
115115

116116
[EndEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.endedit?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_IEditableObject_EndEdit) - Gets called when user move to the next row or press Enter key to commit changes in underlying data object since last `BeginEdit` call.
117117

@@ -127,7 +127,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
127127
/// Gets or sets the ID.
128128
/// </summary>
129129
/// <value>The ID.</value>
130-
131130
public int ID
132131
{
133132
get
@@ -146,7 +145,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
146145
/// Gets or sets the first name.
147146
/// </summary>
148147
/// <value>The first name.</value>
149-
150148
public string FirstName
151149
{
152150
get { return _firstName; }
@@ -162,7 +160,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
162160
/// Gets or sets the last name.
163161
/// </summary>
164162
/// <value>The last name.</value>
165-
166163
public string LastName
167164
{
168165
get { return _lastName; }
@@ -178,7 +175,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
178175
/// Gets or sets the title.
179176
/// </summary>
180177
/// <value>The title.</value>
181-
182178
public string Title
183179
{
184180
get
@@ -197,7 +193,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
197193
/// Gets or sets the salary.
198194
/// </summary>
199195
/// <value>The salary.</value>
200-
201196
public double? Salary
202197
{
203198
get
@@ -216,7 +211,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
216211
/// Gets or sets the reports to.
217212
/// </summary>
218213
/// <value>The reports to.</value>
219-
220214
public int ReportsTo
221215
{
222216
get
@@ -237,7 +231,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
237231

238232
foreach (var pDescriptor in itemProperties)
239233
{
240-
241234
if (pDescriptor.CanWrite)
242235
dictionary.Add(pDescriptor.Name, pDescriptor.GetValue(this));
243236
}
@@ -253,7 +246,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
253246

254247
public void CancelEdit()
255248
{
256-
257249
if (this.storedValues == null)
258250
return;
259251

@@ -269,7 +261,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
269261

270262
public void EndEdit()
271263
{
272-
273264
if (this.storedValues != null)
274265
{
275266
this.storedValues.Clear();
@@ -281,7 +272,6 @@ public class EmployeeInfo : IEditableObject, INotifyPropertyChanged
281272

282273
public void RaisePropertyChanged(string propertyName)
283274
{
284-
285275
if (PropertyChanged != null)
286276
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
287277
}
@@ -296,7 +286,7 @@ SfTreeGrid triggers the following events during editing.
296286

297287
### CurrentCellBeginEdit Event
298288

299-
[CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event occurs when the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_CurrentCell) enter into edit mode. [TreeCurrentCellBeginEditEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellBeginEditEventArgs.html) has following members which provides information for `CurrentCellBeginEdit` event.
289+
[CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_CurrentCellBeginEdit) event occurs when the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_CurrentCell) enter into edit mode. [TreeCurrentCellBeginEditEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellBeginEditEventArgs.html) has following members which provides information for `CurrentCellBeginEdit` event.
300290

301291
* [Cancel](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.canceleventargs.cancel?redirectedfrom=MSDN&view=net-5.0#System_ComponentModel_CancelEventArgs_Cancel) : When set to `true`, the event is canceled and the `CurrentCell` does not enter into the edit mode.
302292

@@ -318,8 +308,8 @@ void TreeGrid_CurrentCellBeginEdit(object sender, TreeGridCurrentCellBeginEditEv
318308

319309
### CurrentCellEndEdit Event
320310

321-
[CurrentCellEndEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event occurs when the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_CurrentCell) exits the edit mode.
322-
[CurrentCellEndEditEventArgs]() has following members which provides information for `CurrentCellEndEdit` event.
311+
[CurrentCellEndEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_CurrentCellEndEdit) event occurs when the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_CurrentCell) exits the edit mode.
312+
[CurrentCellEndEditEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellEndEditEventArgs.html) has following members which provides information for `CurrentCellEndEdit` event.
323313

324314
* RowColumnIndex : Gets the value for the current row column index.
325315

@@ -337,7 +327,7 @@ void TreeGrid_CurrentCellEndEdit(object sender, CurrentCellEndEditEventArgs args
337327

338328
### CurrentCellValueChanged Event
339329

340-
[CurrentCellValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event occurs whenever a value changes in TreeGridColumn that supports editing.
330+
[CurrentCellValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_CurrentCellValueChanged) event occurs whenever a value changes in TreeGridColumn that supports editing.
341331
[TreeGridCurrentCellValueChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellValueChangedEventArgs.html) has following members which provides information for `CurrentCellValueChanged` event.
342332

343333
* [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellValueChangedEventArgs.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellValueChangedEventArgs_Column) : Gets the Grid Column of the SfTreeGrid.
@@ -359,7 +349,7 @@ N> For TreeGridComboBoxColumn, you have to use the 'CurrentCellDropDownSelection
359349

360350
### CurrentCellDropDownSelectionChanged Event
361351

362-
[CurrentCellDropDownSelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event occurs whenever the `SelectedItem` of `TreeGridComboBoxColumn` column changed.
352+
[CurrentCellDropDownSelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_CurrentCellDropDownSelectionChanged) event occurs whenever the `SelectedItem` of `TreeGridComboBoxColumn` column changed.
363353
[CurrentCellDropDownSelectionChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellDropDownSelectionChangedEventArgs.html) has following members which provides information for `CurrentCellDropDownSelectionChanged` event.
364354

365355
* [RowColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellDropDownSelectionChangedEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellDropDownSelectionChangedEventArgs_RowColumnIndex) - Gets the RowColumnIndex of the corresponding item that were selected from the drop-down control.
@@ -382,7 +372,7 @@ void TreeGrid_CurrentCellDropDownSelectionChanged(object sender, CurrentCellDrop
382372

383373
### BeginEdit
384374

385-
SfTreeGrid allows you to edit the cell programmatically by calling the [BeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_BeginEdit) method. Initially the[CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_CurrentCell) need to set before calling the `BeginEdit` method when the CurrentCell value is null.
375+
SfTreeGrid allows you to edit the cell programmatically by calling the [BeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_BeginEdit) method. Initially the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridCurrentCellManager.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridCurrentCellManager_CurrentCell) need to set before calling the `BeginEdit` method when the CurrentCell value is null.
386376

387377
{% tabs %}
388378
{% highlight c# %}
@@ -420,7 +410,7 @@ void TreeGrid_Loaded(object sender, RoutedEventArgs e)
420410

421411
### CancelEdit
422412

423-
You can use the [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event to cancel the editing operation for the corresponding cell.
413+
You can use the [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_CurrentCellBeginEdit) event to cancel the editing operation for the corresponding cell.
424414

425415
{% tabs %}
426416
{% highlight c# %}

0 commit comments

Comments
 (0)