2

To give you background, i am using Silverlight + MVVM and PRISM.

I have some Master data to show in grid and have the first column as hyperlink to the detail data. I am trying to expose some command for a Hyperlink button, but it doesnt seem to work fine.

Here's my XAML ->

            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Detail ID">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <HyperlinkButton Content="{Binding DetailID}" 
                                             Command="{Binding SelectGridItemCommand}" 
                     CommandParameters={Binding}
                                             />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewDataColumn>

        ... [other columns]

</<telerik:RadGridView.Columns>

Basically, I want to do some processing on the text that is present on the Column name and navigate to the detail page.

Can someone help me here..

whihathac
  • 1,741
  • 2
  • 22
  • 38

2 Answers2

2

I found what I was doing wrong. I had bound an Model object in the viewModel to the Grid and when I wrote the binding command in ViewModel, i dint specify that it needs to change the data context to my viewmodel.

Anyways I eventually wrote an delegate and exposed an event in the Model class and subscribed to that event in the ViewModel where I handled it with my custom EventHandlerArgs.

whihathac
  • 1,741
  • 2
  • 22
  • 38
-1

With Caliburn Micro the binding is seamless, if you name control, let's say 'SelectDetail', the adjacent ViewModel's method should be named SelectDetail as well. Evenmore, if you create a boolean property named as CanSelectDetail there will be an 'automagic' binding to IsEnabled Hyperlikn's property

Paulo
  • 172
  • 1
  • 5