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

How through MVVM to call Gird ExpandAll Event

0 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lior
Top achievements
Rank 1
Lior asked on 17 Oct 2012, 02:52 AM
Hi,
 we need to call gird.ExpandAllHierarchyItems method to expand all through a button which is out of gird control. currently we adopt mvvm pattern, we dont want to add event code to code behind. Is this possible to add control in gird for make it call gird event by MVVM?

I've tested  commandparameter in i:triggers in out side buttons by 
  • {binding}
  • {bingding RadTreeListView , ElementName =  radTreeListView }
The parameter  is NOT our expected result, we need to get gird obj to call its expand by programme.

 Any suggestions?   thank you in advanced.

UI.xaml:
<telerik:RadButton
            Content ="{Binding ResourceStrings.LBL_EXPAND_ALL_TITLE, Source={StaticResource LocalizedStrings}}"
            Style="{StaticResource NormalButtonStyle}"
            Grid.Column="1">
          
         <i:Interaction.Triggers>
              <i:EventTrigger EventName="Click">
                       <i:InvokeCommandAction Command="{Binding  ExpandAllCommand, Source={StaticResource ViewModel}}"  CommandParameter="{Binding}"/>
                        </i:EventTrigger>
              </i:Interaction.Triggers>
            </telerik:RadButton>
 
 
   <telerik:RadTreeListView x:Name="radTreeListView"
                            ItemsSource="{Binding BPMLEntities,Mode=TwoWay}" Style="{StaticResource CommonTreeListViewStyle}"
>
 </telerik:RadTreeListView>

Ui.cs
only to bind the viewmodel

ViewModel.cs
public void HandleExpandAllCommand(object obj)
        {
 
        }
Tags
GridView
Asked by
Lior
Top achievements
Rank 1
Share this question
or