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

BeginEdit Command

5 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kowal
Top achievements
Rank 1
Kowal asked on 14 Jul 2010, 11:54 AM
Hi,

I've got a problem when using your RadGridViewCommands.BeginEdit Command.
If there are no rows selected in a gridview or there are no records (rows) at all, the button that has this command attached is not being disabled.

You can easily reproduce this behavior using your demo project where you can add another button:

<telerik:RadButton Width="150" Content="Edit row/cell"
   Command="telerikGrid:RadGridViewCommands.BeginEdit" CommandTarget="{Binding ElementName=RadGridView1}" />

and this line in a codebiegind:

ICommand beginEditCommand = RadGridViewCommands.BeginEdit;

Could you please fix a proper CanExecute method?

Regards,
Kowal

5 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 14 Jul 2010, 12:59 PM
Hello Kowal,

Thank you for the feedback. We will try to improve BeginEdit command in one of our future releases.
Please, excuse us for the inconvenience caused.
I have updated your Telerik points.

All the best,
Yordanka
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
0
Syed Moshiur
Top achievements
Rank 1
answered on 17 Jul 2012, 11:21 AM
Hi, 
I have the same request or question with grid view. My grid allows multiple select. And I am using the internal grid beginedit command which I want to disable on multiple selection also...

Its been two year already since someone posted this issue, Is this resolved. If so please share the solution.
Regards
Moshiur
0
Yordanka
Telerik team
answered on 19 Jul 2012, 06:28 AM
Hi Syed,

Could you be more specific about your scenario and what you are trying to achieve? One option could be to set IsReadOnly="True" for your grid. 
 
Kind regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Syed Moshiur
Top achievements
Rank 1
answered on 19 Jul 2012, 06:36 AM
Dear Ms. Yordanka,
I am using the grid view which is editable and allow multiple selection(e.g. ctrl+a select all) as well. And to activate or deactivate edit mode on cell I have a context menu along with the F2 command. The context menu command calls the telerik grid commands begin edit, however in one case I want to disable the 'edit context menu' if more than one item in the grid is selected. Which would mean I need to hook somehow the canexecuteCommand to the begin edit command of the grid or something like that.
I am using telerik controls q1 2012, Prism 4.0 for MVVM.
Thanks
Moshiur 
0
Dimitrina
Telerik team
answered on 24 Jul 2012, 06:05 AM
Hello,

 You could manage the items of the context menu by subscribing for its Opening event handler. Then get the RadGridView and based on the number of the SelectedItems disable or not the 'edit context menu'.

For example:

private void buttonContextMenu_Opening(object sender, Telerik.Windows.RadRoutedEventArgs e)
       {  
           RadContextMenu menu = e.Source as RadContextMenu;
           RadGridView grid = menu.GetClickedElement<RadGridView>();
           if (grid != null && grid.SelectedItems.Count > 1)
           {
               (menu.Items[0] as RadMenuItem).IsEnabled = false;
           }
       }

 

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Kowal
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Syed Moshiur
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or