The following code behind code is working:
radGridView.EditTriggers = Telerik.Windows.Controls.GridView.GridViewEditTriggers.F2 | Telerik.Windows.Controls.GridView.GridViewEditTriggers.CellClick | Telerik.Windows.Controls.GridView.GridViewEditTriggers.TextInput;
This codes means that the radgridview will accept either F2, CellClick, or TextInput to trigger the cell's edit mode.
But how to do these in a resource like:
<Setter Property="EditTriggers" Value="?" />
I don't know how to specify multiple values inside the value attribute.
Thank you.
4 Answers, 1 is accepted
When specifying it in XAML, you need to separate them with a comma, for example:
Regards,
Didie
Telerik
Hi,
I am doing inline editing for each cell, however after I edit one cell, it automatically goes to the next cell in Edit mode. Any advise how I can prevent that to happen? What I would like to do is, after i edit the cell, it will stay on the cell ive edited (not in Edit mode).
Here is my code:
<telerik:RadGridView x:Name="gvUserList"
EnableRowVirtualization="True"
AutoGenerateColumns="False"
CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed"
ShowGroupPanel="True"
MinHeight="343"
Margin="0,0,0,5"
RowEditEnded="gvCompanyList_RowEditEnded"
EditTriggers="F2, CellClick, TextInput"
CurrentCellChanged="gvUserList_SelectionChanged"
SelectionUnit="Cell" SelectionMode="Extended"
AMT_Utilities:ContextMenuBehavior.ContextMenu="{Binding ElementName=GridContextMenu}">
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu x:Name="GridContextMenu">
<telerik:RadContextMenu.Items>
<telerik:RadMenuItem Header="Edit User Record" />
</telerik:RadContextMenu.Items>
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="ID"
DataMemberBinding="{Binding UserID}"
Width="60" IsVisible="False"/>
<telerik:GridViewDataColumn Header="Last Name"
DataMemberBinding="{Binding LastName}"
Width="*" />
<telerik:GridViewDataColumn Header="First Name"
DataMemberBinding="{Binding FirstName}"
Width="*" />
<telerik:GridViewDataColumn Header="Email"
DataMemberBinding="{Binding Email}"
Width="*" />
<telerik:GridViewDataColumn Header="Country/Territory"
DataMemberBinding="{Binding CountryName}"
Width="*" />
<telerik:GridViewDataColumn Header="Delivery Method"
DataMemberBinding="{Binding DeliveryMethod}"
Width="*" />
<telerik:GridViewDataColumn Header="Phone"
DataMemberBinding="{Binding PhoneNo}"
Width="*" />
<telerik:GridViewDataColumn Header="Username"
DataMemberBinding="{Binding Username}"
Width="*" />
<telerik:GridViewDataColumn Header="Company"
DataMemberBinding="{Binding CompanyName}"
Width="*" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:GridViewDataColumn Header="Delivery Method" Width="*" DataMemberBinding="{Binding DeliveryMethod}" />
<telerik:GridViewDataColumn Header="Phone" Width="Auto" DataMemberBinding="{Binding PhoneNo}" />
<telerik:GridViewDataColumn Header="Username" Width="Auto" DataMemberBinding="{Binding Username}" />
<telerik:GridViewDataColumn Header="Company" Width="*" DataMemberBinding="{Binding CompanyName}" />-->
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Do you press any key, for example Tab, in order to finish editing the cell?
If so, you can define a custom Keyboard Command Provider and specify the handling when the user presses Tab.
Regards,
Dimitrina
Telerik
Hi Dimitrina,
Thanks! This command solve my issue! More power!