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

RadGridViewCommands.BeginInsert Command enabled when?

1 Answer 237 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hermann
Top achievements
Rank 1
hermann asked on 12 Sep 2011, 11:46 AM
Hi,
I have a databound GridView and a RibbonBarButton conecting it to RadGridViewCommands.BeginInsert.
If there is data available (viewmodel.dataitems.Count > 0) then the BeginInsert Button is enabled, if no data is available - when I usually need the BeginInsert command - the button remains disabled.
If I set ShowInsertRow="True" and click on it, then the Button is enabled as well....

So, how can I enable the RibbonBarButton with Command="telerik:RadGridViewCommands.BeginInsert",  CommandParameter="{Binding IsEnabled}" CommandTarget="my:GridView" for an empty RadGridView?

 Thank you,
Hermann

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 13 Sep 2011, 12:57 PM
Hi Hermann,

Basically, whether a button executing BeginInsert command is enabled or not depends on the type of the data source and whether you have a default constructor for your business object, i.e. the general ability to insert new items.
Please take a look at the sample project attached to verify whether it corresponds to your settings and whether you can reproduce the same behavior on it.


Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
hermann
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or