This is a migrated thread and some comments may be shown as answers.

RadButton with telerikGrid:RadGridViewCommands.CommitEdit

1 Answer 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ole
Top achievements
Rank 1
Ole asked on 05 Oct 2010, 12:53 PM
Hi,

Having a Radbutton

<telerik:RadButton Width="150"  Click="RadButton_Click" Content="Save insert/edit" Margin="0,0,5,0" x:Name="btnSave"
Command="telerikGrid:RadGridViewCommands.CommitEdit" CommandTarget="{Binding ElementName=radGridPhases}" />

I have exsperienced that the click event does not get called, is this correct behavior?.

I want to also update my database, when I click this button. How can I run some exstra code, when clicking this button.

Best regards

Ole

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 11 Oct 2010, 12:11 PM
Hi Ole,

Are you sure that the Click event is not fired? I tried to reproduce the problem but the Click event is fired as expected. Unfortunately, for your case, Click is fired before the associated command is executed and as you have indicated you would like to perform some action after that. 

One possible solution is to use Dispatcher in the Click event handler to delay the execution of your code:

private void RadButton_Click(object sender, RoutedEventArgs e)
{
    this.Dispatcher.BeginInvoke(new Action(() =>
    {
        // commit to database
    }));
}


Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Ole
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or