This question is locked. New answers and comments are not allowed.
Hi,
i have a problem with the ActionOnLostFocus property of the RadGridView control.
I am using RadGridCommands to edit rows in my Grid. There are an edit, save and cancel button and they work fine. But when a row is in edit mode and it loses focus, the event arguments show that the EditAction is set to commit, no matter what I set to the ActionOnLostFocus property of the GridView.
Here is my XAML:
...
<telerik:RadButton Width="150" Content="Edit Permission" Margin="0,0,5,0"
Command="telerikGrid:RadGridViewCommands.BeginEdit" CommandTarget="{Binding ElementName=RoleGrid}" />
<telerik:RadButton Width="150" Content="Save insert/edit" Margin="0,0,5,0"
Command="telerikGrid:RadGridViewCommands.CommitEdit" CommandTarget="{Binding ElementName=RoleGrid}" />
<telerik:RadButton Width="150" Content="Cancel insert/edit"
Command="telerikGrid:RadGridViewCommands.CancelRowEdit" CommandTarget="{Binding ElementName=RoleGrid}" />
...
<telerik:RadGridView x:Name="RoleGrid" Grid.Row="1" Margin="5" EditTriggers="None" ActionOnLostFocus="CancelEdit"
ItemsSource="{Binding RolePermissions}" SelectionMode="Single"
SelectedItem="{Binding SelectedPermission, Mode=TwoWay}"
CanUserSortColumns="True" CanUserInsertRows="True" CanUserDeleteRows="True"
AutoGenerateColumns="false" ShowGroupPanel="False" CanUserReorderColumns="False">
...
I am using MVVM light and binding the event to a command, but it´s the same with a simple event handler.
The code looks like this:
private void UpdateRowData(GridViewRowEditEndedEventArgs e)
{
if (e.EditAction == GridViewEditAction.Commit)
{
//save data
}
else
//cancel action
}
Is this a known issue? Did I miss anything? The version I am using is 2012.1.215.1050.
Best Regards
i have a problem with the ActionOnLostFocus property of the RadGridView control.
I am using RadGridCommands to edit rows in my Grid. There are an edit, save and cancel button and they work fine. But when a row is in edit mode and it loses focus, the event arguments show that the EditAction is set to commit, no matter what I set to the ActionOnLostFocus property of the GridView.
Here is my XAML:
...
<telerik:RadButton Width="150" Content="Edit Permission" Margin="0,0,5,0"
Command="telerikGrid:RadGridViewCommands.BeginEdit" CommandTarget="{Binding ElementName=RoleGrid}" />
<telerik:RadButton Width="150" Content="Save insert/edit" Margin="0,0,5,0"
Command="telerikGrid:RadGridViewCommands.CommitEdit" CommandTarget="{Binding ElementName=RoleGrid}" />
<telerik:RadButton Width="150" Content="Cancel insert/edit"
Command="telerikGrid:RadGridViewCommands.CancelRowEdit" CommandTarget="{Binding ElementName=RoleGrid}" />
...
<telerik:RadGridView x:Name="RoleGrid" Grid.Row="1" Margin="5" EditTriggers="None" ActionOnLostFocus="CancelEdit"
ItemsSource="{Binding RolePermissions}" SelectionMode="Single"
SelectedItem="{Binding SelectedPermission, Mode=TwoWay}"
CanUserSortColumns="True" CanUserInsertRows="True" CanUserDeleteRows="True"
AutoGenerateColumns="false" ShowGroupPanel="False" CanUserReorderColumns="False">
...
I am using MVVM light and binding the event to a command, but it´s the same with a simple event handler.
The code looks like this:
private void UpdateRowData(GridViewRowEditEndedEventArgs e)
{
if (e.EditAction == GridViewEditAction.Commit)
{
//save data
}
else
//cancel action
}
Is this a known issue? Did I miss anything? The version I am using is 2012.1.215.1050.
Best Regards