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

CellTemplate Binding

2 Answers 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 17 May 2011, 03:29 AM
I'm using MEF to resolve my ViewModel to my View (the satisfy imports is in the MainView.cs file) and I have a custom cell template that looks like the sytax below :

 

 

 

<telerik:GridViewColumn.CellTemplate>

 

 

 

 

    <DataTemplate>

 

 

 

 

            <HyperlinkButton Margin="5,0,0,0" Visibility="Visible" ToolTipService.ToolTip="Edit" Command="{Binding Path= DataContext.EditContact, ElementName= MainView}" CommandParameter="{Binding Path= DataContext.SelectedContact,ElementName= MainView}">

 

 

 

 

                <Image Visibility="Visible" Source="/Images/tools.png"/>

 

 

 

 

            </HyperlinkButton>

 

 

 

 

        </DataTemplate>

 

 

 

 

</telerik:GridViewColumn.CellTemplate>

I can't trigger my RelayCommand from within the grid. Can you assist me in how I can do this considering the way I'm marrying my viewmodel to my view. Your help is greatly appreciated.

 

2 Answers, 1 is accepted

Sort by
0
Joshua
Top achievements
Rank 1
answered on 18 May 2011, 01:49 AM
Any help in this area the hyperlink isn't triggering when in Celltemplate, but works outside.
0
Vlad
Telerik team
answered on 18 May 2011, 07:04 AM
Hi,

 You have different name scope inside templates - you cannot use ElementName binding. You can check this thread for more info. 

Kind regards,
Vlad
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
Joshua
Top achievements
Rank 1
Answers by
Joshua
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or