This question is locked. New answers and comments are not allowed.
Hi,
We created a custom toolbar implemented as RadGridViewToolbar : Behavior<RadGridView>. Please see the following code snippet.
And we added this toolbar as the behavior of the RadGridView:
The user can click the buttons in this toolbar to do all kinds of export stuff. It had been working fine until we upgraded the Telerik control to the latest version (RadControls for Silverlight Q2 2011).
Now, if the GridView is not empty, the first cell will be selected instead of running the button click event handler whenever the user first time click the button in the custom toolbar. After the first time click, the buttons behave normally. It seems that after the GridView is populated with data, it will swallow the first time button click event in the custom toolbar.
Since this problem affect all the GridViews in our project, could you please provide us a solution ASAP?
Thanks a lot!
We created a custom toolbar implemented as RadGridViewToolbar : Behavior<RadGridView>. Please see the following code snippet.
public class RadGridViewToolbar : Behavior<RadGridView> { protected override void OnAttached() { base.OnAttached(); AssociatedObject.Loaded += LoadToolbar; } private void LoadToolbar(object sedner, RoutedEventArgs routedEventArgs) { // If no toolbar control defined in the RadGridView them then do nothing var toolbarControl = AssociatedObject.GetVisuals() .OfType<ContentPresenter>() .FirstOrDefault(control => control.Name == "PART_GridToolbar"); if (toolbarControl == null) return; AssociatedObject.Loaded -= LoadToolbar; var vm = new RadGridViewToolbarViewModel(AssociatedObject); toolbarControl.Content = new RadGridViewToolbarControl(vm.InitToolbarView()); toolbarControl.Visibility = Visibility.Visible; } }
And we added this toolbar as the behavior of the RadGridView:
<System.Windows.Interactivity:Interaction.Behaviors><Toolbar:RadGridViewToolbar/>
The user can click the buttons in this toolbar to do all kinds of export stuff. It had been working fine until we upgraded the Telerik control to the latest version (RadControls for Silverlight Q2 2011).
Now, if the GridView is not empty, the first cell will be selected instead of running the button click event handler whenever the user first time click the button in the custom toolbar. After the first time click, the buttons behave normally. It seems that after the GridView is populated with data, it will swallow the first time button click event in the custom toolbar.
Since this problem affect all the GridViews in our project, could you please provide us a solution ASAP?
Thanks a lot!